mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +00:00
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>
This commit is contained in:
@@ -49,7 +49,7 @@ def open_wrap(
|
||||
raise ValueError("Argument 'newline' not supported in binary mode")
|
||||
|
||||
file_mode = mode.replace("t", "")
|
||||
if isinstance(filename, (str, bytes, os.PathLike)):
|
||||
if isinstance(filename, (str, bytes, os.PathLike, int)):
|
||||
binary_file = cls(filename, file_mode, **kwargs)
|
||||
elif hasattr(filename, "read") or hasattr(filename, "write"):
|
||||
binary_file = cls(None, file_mode, fileobj=filename, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user