Skip to content

Commit 8e97af9

Browse files
make it compatible
1 parent e6b4f18 commit 8e97af9

File tree

18 files changed

+93
-17
lines changed

18 files changed

+93
-17
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pytest-cov = "~=4.1"
1717
python-dateutil = "~=2.9"
1818
tox = "~=4.21"
1919
types-python-dateutil = "~=2.9"
20+
typing-extensions = "~=4.12.2"
2021

2122
[packages]
2223
selenium = "~=4.24"

appium/webdriver/extensions/action_helpers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import TYPE_CHECKING, List, Optional, Self, Tuple, cast
15+
from typing import TYPE_CHECKING, List, Optional, Tuple, cast
16+
17+
try:
18+
from typing import Self
19+
except ImportError:
20+
from typing_extensions import Self
1621

1722
from selenium.webdriver.common.action_chains import ActionChains
1823
from selenium.webdriver.common.actions import interaction

appium/webdriver/extensions/android/common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
from typing import Self
14+
try:
15+
from typing import Self
16+
except ImportError:
17+
from typing_extensions import Self
1518

1619
from selenium.common.exceptions import UnknownMethodException
1720

appium/webdriver/extensions/android/gsm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Self
15+
try:
16+
from typing import Self
17+
except ImportError:
18+
from typing_extensions import Self
1619

1720
from selenium.common.exceptions import UnknownMethodException
1821

appium/webdriver/extensions/android/network.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Self
15+
try:
16+
from typing import Self
17+
except ImportError:
18+
from typing_extensions import Self
1619

1720
from selenium.common.exceptions import UnknownMethodException
1821

appium/webdriver/extensions/android/power.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Self
15+
try:
16+
from typing import Self
17+
except ImportError:
18+
from typing_extensions import Self
1619

1720
from selenium.common.exceptions import UnknownMethodException
1821

appium/webdriver/extensions/android/sms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Self
15+
try:
16+
from typing import Self
17+
except ImportError:
18+
from typing_extensions import Self
1619

1720
from selenium.common.exceptions import UnknownMethodException
1821

appium/webdriver/extensions/applications.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
from typing import Any, Dict, Self, Union
14+
from typing import Any, Dict, Union
15+
16+
try:
17+
from typing import Self
18+
except ImportError:
19+
from typing_extensions import Self
1520

1621
from selenium.common.exceptions import InvalidArgumentException, UnknownMethodException
1722

appium/webdriver/extensions/clipboard.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
# limitations under the License.
1414

1515
import base64
16-
from typing import Optional, Self
16+
from typing import Optional
17+
18+
try:
19+
from typing import Self
20+
except ImportError:
21+
from typing_extensions import Self
1722

1823
from selenium.common.exceptions import UnknownMethodException
1924

appium/webdriver/extensions/execute_mobile_command.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Any, Dict, Self
15+
from typing import Any, Dict
16+
17+
try:
18+
from typing import Self
19+
except ImportError:
20+
from typing_extensions import Self
1621

1722
from appium.protocols.webdriver.can_execute_scripts import CanExecuteScripts
1823

0 commit comments

Comments
 (0)