diff options
| author | J08nY | 2020-03-04 00:04:53 +0100 |
|---|---|---|
| committer | J08nY | 2020-03-04 00:04:53 +0100 |
| commit | a97f49ebe3c8e28d2a9ba76711555a3378b62341 (patch) | |
| tree | d6064aec39573ad9e83607dbed5873d7872aed21 /pyecsca/sca/target | |
| parent | deca0e3d89ff4483dd6b6b4ad99b3400145bee5b (diff) | |
| download | pyecsca-a97f49ebe3c8e28d2a9ba76711555a3378b62341.tar.gz pyecsca-a97f49ebe3c8e28d2a9ba76711555a3378b62341.tar.zst pyecsca-a97f49ebe3c8e28d2a9ba76711555a3378b62341.zip | |
Fix some type issues.
Diffstat (limited to 'pyecsca/sca/target')
| -rw-r--r-- | pyecsca/sca/target/binary.py | 4 | ||||
| -rw-r--r-- | pyecsca/sca/target/chipwhisperer.py | 2 | ||||
| -rw-r--r-- | pyecsca/sca/target/flash.py | 2 | ||||
| -rw-r--r-- | pyecsca/sca/target/serial.py | 2 | ||||
| -rw-r--r-- | pyecsca/sca/target/simpleserial.py | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/pyecsca/sca/target/binary.py b/pyecsca/sca/target/binary.py index 9a469b6..cb4c918 100644 --- a/pyecsca/sca/target/binary.py +++ b/pyecsca/sca/target/binary.py @@ -14,7 +14,7 @@ class BinaryTarget(SerialTarget): debug_output: bool def __init__(self, binary: Union[str, List[str]], debug_output: bool = False, **kwargs): - super().__init__(**kwargs) + super().__init__() if not isinstance(binary, (str, list)): raise TypeError if isinstance(binary, str): @@ -34,7 +34,7 @@ class BinaryTarget(SerialTarget): self.process.stdin.write(data.decode()) self.process.stdin.flush() - def read(self, num: Optional[int] = 0, timeout: Optional[int] = 0) -> bytes: + def read(self, num: int = 0, timeout: int = 0) -> bytes: if self.process is None: raise ValueError if num != 0: diff --git a/pyecsca/sca/target/chipwhisperer.py b/pyecsca/sca/target/chipwhisperer.py index 3710195..3dd5686 100644 --- a/pyecsca/sca/target/chipwhisperer.py +++ b/pyecsca/sca/target/chipwhisperer.py @@ -36,7 +36,7 @@ class ChipWhispererTarget(Flashable, SimpleSerialTarget): # pragma: no cover self.target.flush() self.target.write(data.decode()) - def read(self, num: Optional[int] = 0, timeout: Optional[int] = 0) -> bytes: + def read(self, num: int = 0, timeout: int = 0) -> bytes: return self.target.read(num, timeout).encode() def reset(self): diff --git a/pyecsca/sca/target/flash.py b/pyecsca/sca/target/flash.py index be3cfb0..bfdb79f 100644 --- a/pyecsca/sca/target/flash.py +++ b/pyecsca/sca/target/flash.py @@ -8,4 +8,4 @@ class Flashable(ABC): @abstractmethod def flash(self, fw_path: str) -> bool: - ...
\ No newline at end of file + ... diff --git a/pyecsca/sca/target/serial.py b/pyecsca/sca/target/serial.py index 3c0b5c4..ccde326 100644 --- a/pyecsca/sca/target/serial.py +++ b/pyecsca/sca/target/serial.py @@ -14,5 +14,5 @@ class SerialTarget(Target): ... @abstractmethod - def read(self, num: Optional[int] = 0, timeout: Optional[int] = 0) -> bytes: + def read(self, num: int = 0, timeout: int = 0) -> bytes: ... diff --git a/pyecsca/sca/target/simpleserial.py b/pyecsca/sca/target/simpleserial.py index 9e26b79..1ad0b68 100644 --- a/pyecsca/sca/target/simpleserial.py +++ b/pyecsca/sca/target/simpleserial.py @@ -63,7 +63,7 @@ class SimpleSerialTarget(SerialTarget): """ data = bytes(cmd) for i in range(0, len(data), 64): - chunk = data[i:i+64] + chunk = data[i:i + 64] sleep(0.010) self.write(chunk) self.write(b"\n") |
