|
12 | 12 | import struct
|
13 | 13 | import sys
|
14 | 14 | import traceback
|
15 |
| -from enum import EnumType, StrEnum |
| 15 | +from enum import EnumMeta |
| 16 | + |
16 | 17 | from pathlib import Path
|
17 | 18 | from threading import Event, Thread
|
18 | 19 | from time import sleep, time
|
@@ -171,7 +172,7 @@ def set_attribute(self, urb: URBBase, name: str, value: Any):
|
171 | 172 | elif value.startswith('0x'):
|
172 | 173 | value = self.from_hex(value)
|
173 | 174 |
|
174 |
| - if type(field[0].type) == EnumType: # pylint: disable=unidiomatic-typecheck |
| 175 | + if type(field[0].type) == EnumMeta: # pylint: disable=unidiomatic-typecheck |
175 | 176 | value = int(value)
|
176 | 177 | typed_value = field[0].type(value)
|
177 | 178 | setattr(urb, name, typed_value)
|
@@ -419,10 +420,10 @@ class MockUSBIP:
|
419 | 420 | """mock USBIP server"""
|
420 | 421 | STARTUP_TIMEOUT: float = 5.0
|
421 | 422 |
|
422 |
| - class DebugCommands(StrEnum): |
| 423 | + class DebugCommands: |
423 | 424 | """commands that are tunneled and their expected behavior"""
|
424 |
| - NO_WRITE_RESPONSE = 'no-write-response' # write does not return acknowledgement |
425 |
| - NO_READ_RESPONSE = 'no-read-response' # suppress an expected read |
| 425 | + NO_WRITE_RESPONSE: str = 'no-write-response' # write does not return acknowledgement |
| 426 | + NO_READ_RESPONSE: str = 'no-read-response' # suppress an expected read |
426 | 427 |
|
427 | 428 | def __init__(self, host: str, port: int, socket_class: type = SocketWrapper):
|
428 | 429 | """set up our instance"""
|
|
0 commit comments