Skip to content

Commit

Permalink
use Optional instead of | None for python < 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
julienbarrier committed Aug 31, 2023
1 parent 1813364 commit 8d8a367
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion qcodes_contrib_drivers/drivers/Thorlabs/KDC101.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ def __init__(self,
self._dll_path = dll_path
else:
self._dll_path = 'Thorlabs.MotionControl.KCube.DCServo.dll'
self._dll_dir: str | None = dll_dir if dll_dir else None
self._dll_dir: Optional[str] = dll_dir if dll_dir else None
super().__init__(name, serial_number, self._dll_path, self._dll_dir,
simulation, polling, home, **kwargs)
2 changes: 1 addition & 1 deletion qcodes_contrib_drivers/drivers/Thorlabs/KLS1550.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ def __init__(self,
self._dll_path = dll_path
else:
self._dll_path = 'Thorlabs.MotionControl.KCube.LaserSource.dll'
self._dll_dir: str | None = dll_dir if dll_dir else None
self._dll_dir: Optional[str] = dll_dir if dll_dir else None
super().__init__(name, serial_number, self._dll_path, self._dll_dir,
simulation, polling, **kwargs)
2 changes: 1 addition & 1 deletion qcodes_contrib_drivers/drivers/Thorlabs/TDC001.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ def __init__(self,
self._dll_path = dll_path
else:
self._dll_path = 'Thorlabs.MotionControl.TCube.DCServo.dll'
self._dll_dir: str | None = dll_dir if dll_dir else None
self._dll_dir: Optional[str] = dll_dir if dll_dir else None
super().__init__(name, serial_number, self._dll_path, self._dll_dir,
simulation, polling, home, **kwargs)
2 changes: 1 addition & 1 deletion qcodes_contrib_drivers/drivers/Thorlabs/private/kinesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self,
self.serial_number = serial_number
self._serial_number = ctypes.c_char_p(self.serial_number.encode('ascii'))
self._dll_path = dll_path
self._dll_dir: str | None = dll_dir if dll_dir else r'C:\Program Files\Thorlabs\Kinesis'
self._dll_dir: Optional[str] = dll_dir if dll_dir else r'C:\Program Files\Thorlabs\Kinesis'
if sys.platform != 'win32':
self._dll: Any = None
raise OSError('Thorlabs Kinesis only works on Windows')
Expand Down

0 comments on commit 8d8a367

Please sign in to comment.