Skip to content

Commit b54012b

Browse files
Merge pull request #67 from python-accelerator-middle-layer/3.10-compatibility
3.10 compatibility
2 parents 9386b03 + e47ad94 commit b54012b

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎pyaml/bpm/bpm.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
from ..lattice.abstract_impl import RBpmArray, RWBpmOffsetArray, RWBpmTiltScalar
33
from ..bpm.bpm_model import BPMModel
44
from ..common.exception import PyAMLException
5-
6-
from typing import Self
5+
try:
6+
from typing import Self # Python 3.11+
7+
except ImportError:
8+
from typing_extensions import Self # Python 3.10 and earlier
79

810
PYAMLCLASS = "BPM"
911

‎pyaml/diagnostics/tune_monitor.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from ..common.element import Element, ElementConfigModel
22
from ..common.abstract import ReadFloatArray
33
from ..control.deviceaccess import DeviceAccess
4-
5-
from typing import Self
4+
try:
5+
from typing import Self # Python 3.11+
6+
except ImportError:
7+
from typing_extensions import Self # Python 3.10 and earlier
68
from pydantic import ConfigDict
79

810
PYAMLCLASS = "BetatronTuneMonitor"

0 commit comments

Comments
 (0)