summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ioctl/__init__.py4
-rw-r--r--ioctl/hidraw.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/ioctl/__init__.py b/ioctl/__init__.py
index a7b9ffb..2b38d6f 100644
--- a/ioctl/__init__.py
+++ b/ioctl/__init__.py
@@ -3,7 +3,7 @@
import array
import fcntl
-from typing import BinaryIO, Optional, Union
+from typing import Optional, Union
__all__ = ['IOCTL']
@@ -50,7 +50,7 @@ class IOCTL(object):
(size << self.SIZESHIFT)
)
- def perform(self, fd: BinaryIO, buf: Optional[Union[str, bytes, 'array.array[int]']] = None) -> bytearray:
+ def perform(self, fd: int, buf: Optional[Union[str, bytes, 'array.array[int]']] = None) -> bytearray:
'''
Performs the ioctl
'''
diff --git a/ioctl/hidraw.py b/ioctl/hidraw.py
index a083683..e41c714 100644
--- a/ioctl/hidraw.py
+++ b/ioctl/hidraw.py
@@ -5,7 +5,7 @@ import ctypes
import fcntl
import os
-from typing import BinaryIO, List, Tuple
+from typing import List, Tuple
import ioctl
@@ -50,7 +50,7 @@ class Hidraw(object):
def __init__(self, path: str, read_length: int = 1024) -> None:
self._path = path
- self._fd = open(path, 'rb+')
+ self._fd = os.open(path, os.O_RDWR)
self.read_length = read_length
fcntl.fcntl(self._fd, fcntl.F_SETFL, os.O_NONBLOCK)
@@ -65,7 +65,7 @@ class Hidraw(object):
return self._path
@property
- def fd(self) -> BinaryIO:
+ def fd(self) -> int:
'''
Node file descriptor
'''