aboutsummaryrefslogtreecommitdiff
path: root/pyfakefs
diff options
context:
space:
mode:
authormrbean-bremen <hansemrbean@googlemail.com>2022-08-27 21:04:19 +0200
committermrbean-bremen <hansemrbean@googlemail.com>2022-08-27 21:04:19 +0200
commit34106ecb6b5b083509a81057fddf616bf0a74822 (patch)
tree10ec27e8d22cff7e153deb7673beb27dacd5dcfa /pyfakefs
parentf0acbb6993a831faeeec4c88a66bde17f3df95ba (diff)
downloadpyfakefs-34106ecb6b5b083509a81057fddf616bf0a74822.tar.gz
Return the expected type from fcntl.ioctl and fcntl.fcntl
- if 'arg' is of type byte, the return value should also be 'byte' - the actual command is ignored as before
Diffstat (limited to 'pyfakefs')
-rw-r--r--pyfakefs/fake_filesystem.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pyfakefs/fake_filesystem.py b/pyfakefs/fake_filesystem.py
index bf5c960..dfa475e 100644
--- a/pyfakefs/fake_filesystem.py
+++ b/pyfakefs/fake_filesystem.py
@@ -5085,11 +5085,11 @@ if sys.platform != 'win32':
self._fcntl_module = fcntl
def fcntl(self, fd: int, cmd: int, arg: int = 0) -> Union[int, bytes]:
- return 0
+ return 0 if isinstance(arg, int) else arg
def ioctl(self, fd: int, request: int, arg: int = 0,
mutate_flag: bool = True) -> Union[int, bytes]:
- return 0
+ return 0 if isinstance(arg, int) else arg
def flock(self, fd: int, operation: int) -> None:
pass