From 6230e947c0c7e6fb15b7bd2584e1b7be37313ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=90=A6?= Date: Thu, 29 Sep 2022 11:41:23 +0800 Subject: [PATCH] change PY34 to PY3 (cherry picked from commit aaa68b9c4267db35b39c9e3d33715cbaeb8b167e) --- airtest/core/android/adb.py | 2 +- airtest/core/android/rotation.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/airtest/core/android/adb.py b/airtest/core/android/adb.py index ebc166d7..fd74b8b1 100644 --- a/airtest/core/android/adb.py +++ b/airtest/core/android/adb.py @@ -483,7 +483,7 @@ def pull(self, remote, local): None """ local = decode_path(local) # py2 - if PY34: + if PY3: # If it is PY3.4 or above, use Path to force / convert to \ from pathlib import Path local = Path(local).as_posix() diff --git a/airtest/core/android/rotation.py b/airtest/core/android/rotation.py index 41572f08..334abeab 100644 --- a/airtest/core/android/rotation.py +++ b/airtest/core/android/rotation.py @@ -3,7 +3,7 @@ import time import threading import traceback -from airtest.utils.snippet import reg_cleanup, is_exiting, on_method_ready +from airtest.utils.snippet import reg_cleanup, is_exiting, on_method_ready, kill_proc from airtest.utils.nbsp import NonBlockingStreamReader from airtest.utils.logger import get_logger from airtest.core.android.constant import ORI_METHOD, ROTATIONWATCHER_JAR @@ -92,9 +92,7 @@ def setup_server(self): def teardown(self): self._t_kill_event.set() if self.ow_proc: - self.ow_proc.kill() - # close io.Buffer - self.ow_proc.communicate() + kill_proc(self.ow_proc) if self.nbsp: self.nbsp.kill() self.ow_callback = []