diff --git a/win/pywinauto/application.py b/win/pywinauto/application.py index f229fcf..7eb04fc 100644 --- a/win/pywinauto/application.py +++ b/win/pywinauto/application.py @@ -1189,7 +1189,7 @@ def process_from_module(module): modules = [] # Get the process names - for i in range(0, bytes_returned.value / ctypes.sizeof(ctypes.c_int)): + for i in range(0, bytes_returned.value // ctypes.sizeof(ctypes.c_int)): try: modules.append((processes[i], process_module(processes[i]))) except ProcessNotFoundError: diff --git a/win/pywinauto/controls/Accessability HwndWrapper.py b/win/pywinauto/controls/Accessability HwndWrapper.py index 690a8f7..e1c9c7f 100644 --- a/win/pywinauto/controls/Accessability HwndWrapper.py +++ b/win/pywinauto/controls/Accessability HwndWrapper.py @@ -1634,9 +1634,9 @@ def _perform_click_input( # set the default coordinates if coords[0] is None: - coords[0] = ctrl.Rectangle().width() / 2 + coords[0] = ctrl.Rectangle().width() // 2 if coords[1] is None: - coords[1] = ctrl.Rectangle().height() / 2 + coords[1] = ctrl.Rectangle().height() // 2 if not absolute: coords[0] = coords[0] + ctrl.Rectangle().left diff --git a/win/pywinauto/controls/HwndWrapper.py b/win/pywinauto/controls/HwndWrapper.py index 66b1f28..4ce165a 100644 --- a/win/pywinauto/controls/HwndWrapper.py +++ b/win/pywinauto/controls/HwndWrapper.py @@ -1533,9 +1533,9 @@ def _perform_click_input( # set the default coordinates if coords[0] is None: - coords[0] = ctrl.Rectangle().width() / 2 + coords[0] = ctrl.Rectangle().width() // 2 if coords[1] is None: - coords[1] = ctrl.Rectangle().height() / 2 + coords[1] = ctrl.Rectangle().height() // 2 if not absolute: coords[0] = coords[0] + ctrl.Rectangle().left diff --git a/win/pywinauto/controls/common_controls.py b/win/pywinauto/controls/common_controls.py index c603f73..23dc543 100644 --- a/win/pywinauto/controls/common_controls.py +++ b/win/pywinauto/controls/common_controls.py @@ -330,7 +330,7 @@ def _as_item_index(self, item): """ index = item if isinstance(item, str): - index = (self.Texts().index(item) - 1) / self.ColumnCount() + index = (self.Texts().index(item) - 1) // self.ColumnCount() return index diff --git a/win/pywinauto/timings.py b/win/pywinauto/timings.py index c7efef6..c83afb8 100644 --- a/win/pywinauto/timings.py +++ b/win/pywinauto/timings.py @@ -184,7 +184,7 @@ def Fast(self): min(1, TimeConfig._timings[setting]) if "_wait" in setting: - TimeConfig._timings[setting] = TimeConfig._timings[setting] / 2 + TimeConfig._timings[setting] = TimeConfig._timings[setting] // 2 elif setting.endswith("_retry"): TimeConfig._timings[setting] = 0.001 diff --git a/win/pywinauto/unittests/test_SendKeys.py b/win/pywinauto/unittests/test_SendKeys.py index 3c82469..f556c86 100644 --- a/win/pywinauto/unittests/test_SendKeys.py +++ b/win/pywinauto/unittests/test_SendKeys.py @@ -27,10 +27,10 @@ >>> print val a >>> ->>> SendKeys(u"ä\\r\\n") +>>> SendKeys(u"ä\\r\\n") >>> val = raw_input() >>> print val -ä +ä >>> """ @@ -157,7 +157,7 @@ def testANSIExtendedCharacters(self): "Make sure that sending any character in range " os.system("chcp 850") matched = 0 - extended_chars = "äëïöüáéíóúâêîôûàèìòùãõñýç" + extended_chars = "äëïöüáéíóúâêîôûàèìòùãõñýç" for char in extended_chars: SendKeys(char + "{ENTER}", pause = .01) diff --git a/win/pywinauto/win32structures.py b/win/pywinauto/win32structures.py index 7fbbad1..3b87d8c 100644 --- a/win/pywinauto/win32structures.py +++ b/win/pywinauto/win32structures.py @@ -250,8 +250,8 @@ def height(self): def mid_point(self): "Return a POINT structure representing the mid point" pt = POINT() - pt.x = int(self.left + self.width()/2) - pt.y = int(self.top + self.height()/2) + pt.x = int(self.left + self.width()//2) + pt.y = int(self.top + self.height()//2) return pt #def __hash__(self):