Skip to content

Commit 024f74f

Browse files
authored
Restore CanExecuteScripts protocol methods
1 parent 1e3475b commit 024f74f

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

appium/protocols/webdriver/can_execute_scripts.py

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

15-
from typing import Any, List, Optional, Protocol, TYPE_CHECKING
16-
from warnings import deprecated
15+
from typing import Any, List, Optional, Protocol
1716

1817

1918
class CanExecuteScripts(Protocol):
20-
def execute_script(self, script: str, *args: Any) -> Any: ...
19+
def pin_script(self, script: str, script_key: Optional[Any] = None) -> Any: ...
2120

22-
# TODO: remove `if not TYPE_CHECKING` guard after properly implement them
23-
# The use of these methods will produce DeprecationWarnings at runtime
24-
if not TYPE_CHECKING:
25-
@deprecated("pin_script is deprecated for removal")
26-
def pin_script(self, script: str, script_key: Optional[Any] = None) -> Any: ...
21+
def unpin(self, script_key: Any) -> None: ...
2722

28-
@deprecated("unpin is deprecated for removal")
29-
def unpin(self, script_key: Any) -> None: ...
23+
def get_pinned_scripts(self) -> List[str]: ...
3024

31-
@deprecated("get_pinned_scripts is deprecated for removal")
32-
def get_pinned_scripts(self) -> List[str]: ...
25+
def execute_script(self, script: str, *args: Any) -> Any: ...
3326

34-
@deprecated("execute_async_script is deprecated for removal")
35-
def execute_async_script(self, script: str, *args: Any) -> Any: ...
27+
def execute_async_script(self, script: str, *args: Any) -> Any: ...

0 commit comments

Comments
 (0)