Rename variables that clash with pdb commands

By default, pdb assumes that any command run is python code to be
evaluated, but only if that code isn't a builtin pdb command. You can
force it to be evaluated as python code by prefixing it with `!`.

It's handy to simply name a python variable and have its variable be
printed.

But single letter variables like 's' and 'p' make debugging with pdb
commands (i.e. 's'tep, and 'p'rint evaluated expressions) less
convenient, and potentially confusing.
pull/12058/head
Dan Hawson 1 year ago committed by Eli Schwartz
parent d4615369ff
commit 7c955618dd
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 4
      unittests/allplatformstests.py
  2. 22
      unittests/baseplatformtests.py

@ -1369,8 +1369,8 @@ class AllPlatformTests(BasePlatformTests):
targets = self.introspect('--targets')
# This assumes all of the targets support lto
for t in targets:
for s in t['target_sources']:
self.assertTrue(expected.issubset(set(s['parameters'])), f'Incorrect values for {t["name"]}')
for src in t['target_sources']:
self.assertTrue(expected.issubset(set(src['parameters'])), f'Incorrect values for {t["name"]}')
def test_dist_git(self):
if not shutil.which('git'):

@ -171,22 +171,22 @@ class BasePlatformTests(TestCase):
env = os.environ.copy()
env.update(override_envvars)
p = subprocess.run(command, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT if stderr else subprocess.PIPE,
env=env,
encoding='utf-8',
text=True, cwd=workdir, timeout=60 * 5)
proc = subprocess.run(command, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT if stderr else subprocess.PIPE,
env=env,
encoding='utf-8',
text=True, cwd=workdir, timeout=60 * 5)
print('$', join_args(command))
print('stdout:')
print(p.stdout)
print(proc.stdout)
if not stderr:
print('stderr:')
print(p.stderr)
if p.returncode != 0:
if 'MESON_SKIP_TEST' in p.stdout:
print(proc.stderr)
if proc.returncode != 0:
if 'MESON_SKIP_TEST' in proc.stdout:
raise SkipTest('Project requested skipping.')
raise subprocess.CalledProcessError(p.returncode, command, output=p.stdout)
return p.stdout
raise subprocess.CalledProcessError(proc.returncode, command, output=proc.stdout)
return proc.stdout
def init(self, srcdir, *,
extra_args=None,

Loading…
Cancel
Save