Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with Python 3.12 #3456

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions testing/mozbase/mozdevice/mozdevice/adb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import tempfile
import time
import traceback
from distutils import dir_util
from shutil import copytree
from threading import Thread

import six
Expand Down Expand Up @@ -2983,7 +2983,7 @@ def push(self, local, remote, timeout=None):
temp_parent = tempfile.mkdtemp()
remote_name = os.path.basename(remote)
new_local = os.path.join(temp_parent, remote_name)
dir_util.copy_tree(local, new_local)
copytree(local, new_local)
local = new_local
# See do_sync_push in
# https://android.googlesource.com/platform/system/core/+/master/adb/file_sync_client.cpp
Expand Down Expand Up @@ -3136,7 +3136,7 @@ def pull(self, remote, local, timeout=None):
self.rm(intermediate, recursive=True, force=True, timeout=timeout)
finally:
if copy_required:
dir_util.copy_tree(local, original_local)
copytree(local, original_local, dirs_exist_ok=True)
shutil.rmtree(temp_parent)

def get_file(self, remote, offset=None, length=None, timeout=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def read_stdout(self):
self.last_test_seen = "Last test finished"
elif message.get("action") == "log":
line = message["message"].strip()
m = re.match(".*:\s*(\d*)", line)
m = re.match(r".*:\s*(\d*)", line)
if m:
try:
val = int(m.group(1))
Expand Down
6 changes: 3 additions & 3 deletions testing/mozbase/mozrunner/mozrunner/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import posixpath
from abc import ABCMeta, abstractmethod
from distutils.spawn import find_executable
from shutil import which

import six
from mozdevice import ADBDeviceFactory
Expand Down Expand Up @@ -51,7 +51,7 @@ class RemoteContext(object):
@property
def bindir(self):
if self._bindir is None:
paths = [find_executable("emulator")]
paths = [which("emulator")]
paths = [p for p in paths if p is not None if os.path.isfile(p)]
if not paths:
self._bindir = ""
Expand Down Expand Up @@ -88,7 +88,7 @@ def which(self, binary):
paths.insert(0, os.path.abspath(self.bindir))
os.environ["PATH"] = os.pathsep.join(paths)

return find_executable(binary)
return which(binary)

@abstractmethod
def stop_application(self):
Expand Down
Loading