summaryrefslogtreecommitdiffstats
path: root/contrib/tools/cython/Cython/Debugger/Tests/TestLibCython.py
diff options
context:
space:
mode:
authororivej <[email protected]>2022-02-10 16:44:49 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:44:49 +0300
commit718c552901d703c502ccbefdfc3c9028d608b947 (patch)
tree46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/tools/cython/Cython/Debugger/Tests/TestLibCython.py
parente9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/cython/Cython/Debugger/Tests/TestLibCython.py')
-rw-r--r--contrib/tools/cython/Cython/Debugger/Tests/TestLibCython.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/contrib/tools/cython/Cython/Debugger/Tests/TestLibCython.py b/contrib/tools/cython/Cython/Debugger/Tests/TestLibCython.py
index 13560646ffc..a23d31f534f 100644
--- a/contrib/tools/cython/Cython/Debugger/Tests/TestLibCython.py
+++ b/contrib/tools/cython/Cython/Debugger/Tests/TestLibCython.py
@@ -14,7 +14,7 @@ from distutils import ccompiler
import runtests
import Cython.Distutils.extension
-import Cython.Distutils.old_build_ext as build_ext
+import Cython.Distutils.old_build_ext as build_ext
from Cython.Debugger import Cygdb as cygdb
root = os.path.dirname(os.path.abspath(__file__))
@@ -31,38 +31,38 @@ def test_gdb():
if have_gdb is not None:
return have_gdb
- have_gdb = False
+ have_gdb = False
try:
- p = subprocess.Popen(['gdb', '-nx', '--version'], stdout=subprocess.PIPE)
+ p = subprocess.Popen(['gdb', '-nx', '--version'], stdout=subprocess.PIPE)
except OSError:
- # gdb not found
- gdb_version = None
+ # gdb not found
+ gdb_version = None
else:
- stdout, _ = p.communicate()
+ stdout, _ = p.communicate()
# Based on Lib/test/test_gdb.py
- regex = r"GNU gdb [^\d]*(\d+)\.(\d+)"
- gdb_version = re.match(regex, stdout.decode('ascii', 'ignore'))
+ regex = r"GNU gdb [^\d]*(\d+)\.(\d+)"
+ gdb_version = re.match(regex, stdout.decode('ascii', 'ignore'))
- if gdb_version:
- gdb_version_number = list(map(int, gdb_version.groups()))
+ if gdb_version:
+ gdb_version_number = list(map(int, gdb_version.groups()))
if gdb_version_number >= [7, 2]:
- have_gdb = True
- with tempfile.NamedTemporaryFile(mode='w+') as python_version_script:
+ have_gdb = True
+ with tempfile.NamedTemporaryFile(mode='w+') as python_version_script:
python_version_script.write(
'python import sys; print("%s %s" % sys.version_info[:2])')
python_version_script.flush()
p = subprocess.Popen(['gdb', '-batch', '-x', python_version_script.name],
stdout=subprocess.PIPE)
- stdout, _ = p.communicate()
+ stdout, _ = p.communicate()
try:
- internal_python_version = list(map(int, stdout.decode('ascii', 'ignore').split()))
- if internal_python_version < [2, 6]:
- have_gdb = False
+ internal_python_version = list(map(int, stdout.decode('ascii', 'ignore').split()))
+ if internal_python_version < [2, 6]:
+ have_gdb = False
except ValueError:
have_gdb = False
- if not have_gdb:
- warnings.warn('Skipping gdb tests, need gdb >= 7.2 with Python >= 2.6')
+ if not have_gdb:
+ warnings.warn('Skipping gdb tests, need gdb >= 7.2 with Python >= 2.6')
return have_gdb