Skip to content

Commit

Permalink
added deprecated decorator to base_wrapper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cetygamer committed May 13, 2018
1 parent fd27458 commit 48f8c4c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pywinauto/base_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import time
import win32process
import six
import warnings

try:
from PIL import ImageGrab
Expand All @@ -52,6 +53,17 @@
from .actionlogger import ActionLogger
from .mouse import _perform_click_input


#=========================================================================
def deprecated(method):
"""Decorator for deprecated methods"""
def wrap(*args, **kwargs):
warnings.simplefilter("default", DeprecationWarning)
warnings.warn("Non PEP-8 compliant methods are deprecated", DeprecationWarning, stacklevel=2)
return method(*args, **kwargs)

return wrap

#=========================================================================
def remove_non_alphanumeric_symbols(s):
"""Make text usable for attribute name"""
Expand Down Expand Up @@ -104,7 +116,7 @@ class BaseWrapper(object):
has_title = True

#------------------------------------------------------------
def __new__(cls, element_info):
def __new__(cls, element_info, active_backend):
return BaseWrapper._create_wrapper(cls, element_info, BaseWrapper)

#------------------------------------------------------------
Expand Down

0 comments on commit 48f8c4c

Please sign in to comment.