diff options
Diffstat (limited to 'setuptools/tests/files.py')
| -rw-r--r-- | setuptools/tests/files.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/setuptools/tests/files.py b/setuptools/tests/files.py index 98de9fc3..465a6b41 100644 --- a/setuptools/tests/files.py +++ b/setuptools/tests/files.py @@ -30,5 +30,9 @@ def build_files(file_defs, prefix=""): pkg_resources.py31compat.makedirs(full_name, exist_ok=True) build_files(contents, prefix=full_name) else: - with open(full_name, 'w') as f: - f.write(contents) + if isinstance(contents, bytes): + with open(full_name, 'wb') as f: + f.write(contents) + else: + with open(full_name, 'w') as f: + f.write(contents) |
