diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-13 16:11:02 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-14 22:37:43 +0100 |
| commit | d080eaa163620c29848f2311064dd919c051234c (patch) | |
| tree | 6fb32786f4a9fb93ffbae957ab702ba89a9cca1d /bitbake/lib/bb/compress/_pipecompress.py | |
| parent | 5cd1fd86f49ef98f4fb24b0e4806583bd201cb99 (diff) | |
| download | poky-d080eaa163620c29848f2311064dd919c051234c.tar.gz | |
bitbake: compress: Allow to operate on file descriptor
The code works fine if we pass a file descriptor in and we need to
do this from the siggen code so add that as a valid input.
(Bitbake rev: fc8d74b7de576005ecf67920501dc7e694880fda)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/compress/_pipecompress.py')
| -rw-r--r-- | bitbake/lib/bb/compress/_pipecompress.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/compress/_pipecompress.py b/bitbake/lib/bb/compress/_pipecompress.py index 4b9f662143..5de17a82e2 100644 --- a/bitbake/lib/bb/compress/_pipecompress.py +++ b/bitbake/lib/bb/compress/_pipecompress.py | |||
| @@ -49,7 +49,7 @@ def open_wrap( | |||
| 49 | raise ValueError("Argument 'newline' not supported in binary mode") | 49 | raise ValueError("Argument 'newline' not supported in binary mode") |
| 50 | 50 | ||
| 51 | file_mode = mode.replace("t", "") | 51 | file_mode = mode.replace("t", "") |
| 52 | if isinstance(filename, (str, bytes, os.PathLike)): | 52 | if isinstance(filename, (str, bytes, os.PathLike, int)): |
| 53 | binary_file = cls(filename, file_mode, **kwargs) | 53 | binary_file = cls(filename, file_mode, **kwargs) |
| 54 | elif hasattr(filename, "read") or hasattr(filename, "write"): | 54 | elif hasattr(filename, "read") or hasattr(filename, "write"): |
| 55 | binary_file = cls(None, file_mode, fileobj=filename, **kwargs) | 55 | binary_file = cls(None, file_mode, fileobj=filename, **kwargs) |
