summaryrefslogtreecommitdiff
path: root/tools/patman
diff options
context:
space:
mode:
Diffstat (limited to 'tools/patman')
-rwxr-xr-xtools/patman/__main__.py6
-rw-r--r--tools/patman/func_test.py4
2 files changed, 7 insertions, 3 deletions
diff --git a/tools/patman/__main__.py b/tools/patman/__main__.py
index 48ffbc8eadf..8eba5d34864 100755
--- a/tools/patman/__main__.py
+++ b/tools/patman/__main__.py
@@ -7,7 +7,11 @@
"""See README for more information"""
from argparse import ArgumentParser
-import importlib.resources
+try:
+ import importlib.resources
+except ImportError:
+ # for Python 3.6
+ import importlib_resources
import os
import re
import sys
diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py
index 42ac4ed77b7..e3918497cf4 100644
--- a/tools/patman/func_test.py
+++ b/tools/patman/func_test.py
@@ -489,8 +489,8 @@ complicated as possible''')
# pylint: disable=E1101
self.repo.checkout(target, strategy=pygit2.GIT_CHECKOUT_FORCE)
control.setup()
+ orig_dir = os.getcwd()
try:
- orig_dir = os.getcwd()
os.chdir(self.gitdir)
# Check that it can detect the current branch
@@ -679,8 +679,8 @@ diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
self.repo.checkout(target, strategy=pygit2.GIT_CHECKOUT_FORCE)
# Check that it can detect the current branch
+ orig_dir = os.getcwd()
try:
- orig_dir = os.getcwd()
os.chdir(self.gitdir)
with self.assertRaises(ValueError) as exc:
gitutil.count_commits_to_branch(None)