diff options
author | Guido van Rossum <guido@python.org> | 2023-11-01 20:13:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 20:13:02 (GMT) |
commit | 7e135a48d619407cd4b2a6d80a4ce204b2f5f938 (patch) | |
tree | e0f063e3993696fc700092f50a1cee81f97974ff /Lib | |
parent | 5d6db168b9cda58b4897763041a6109b93e421cb (diff) | |
download | cpython-7e135a48d619407cd4b2a6d80a4ce204b2f5f938.zip cpython-7e135a48d619407cd4b2a6d80a4ce204b2f5f938.tar.gz cpython-7e135a48d619407cd4b2a6d80a4ce204b2f5f938.tar.bz2 |
gh-111520: Integrate the Tier 2 interpreter in the Tier 1 interpreter (#111428)
- There is no longer a separate Python/executor.c file.
- Conventions in Python/bytecodes.c are slightly different -- don't use `goto error`,
you must use `GOTO_ERROR(error)` (same for others like `unused_local_error`).
- The `TIER_ONE` and `TIER_TWO` symbols are only valid in the generated (.c.h) files.
- In Lib/test/support/__init__.py, `Py_C_RECURSION_LIMIT` is imported from `_testcapi`.
- On Windows, in debug mode, stack allocation grows from 8MiB to 12MiB.
- **Beware!** This changes the env vars to enable uops and their debugging
to `PYTHON_UOPS` and `PYTHON_LLTRACE`.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/support/__init__.py | 11 | ||||
-rw-r--r-- | Lib/test/test_generated_cases.py | 8 |
2 files changed, 14 insertions, 5 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index de7db70..f64f88d 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -2355,8 +2355,15 @@ def adjust_int_max_str_digits(max_digits): #For recursion tests, easily exceeds default recursion limit EXCEEDS_RECURSION_LIMIT = 5000 -# The default C recursion limit (from Include/cpython/pystate.h). -Py_C_RECURSION_LIMIT = 1500 +def _get_c_recursion_limit(): + try: + import _testcapi + return _testcapi.Py_C_RECURSION_LIMIT + except (ImportError, AttributeError): + return 1500 # (from Include/cpython/pystate.h) + +# The default C recursion limit. +Py_C_RECURSION_LIMIT = _get_c_recursion_limit() #Windows doesn't have os.uname() but it doesn't support s390x. skip_on_s390x = unittest.skipIf(hasattr(os, 'uname') and os.uname().machine == 's390x', diff --git a/Lib/test/test_generated_cases.py b/Lib/test/test_generated_cases.py index 475d749..ea0c116 100644 --- a/Lib/test/test_generated_cases.py +++ b/Lib/test/test_generated_cases.py @@ -118,17 +118,19 @@ class TestGeneratedCases(unittest.TestCase): with open(self.temp_output_filename) as temp_output: lines = temp_output.readlines() - while lines and lines[0].startswith("// "): + while lines and lines[0].startswith(("// ", "#", " #", "\n")): lines.pop(0) + while lines and lines[-1].startswith(("#", "\n")): + lines.pop(-1) actual = "".join(lines) - # if actual.rstrip() != expected.rstrip(): + # if actual.strip() != expected.strip(): # print("Actual:") # print(actual) # print("Expected:") # print(expected) # print("End") - self.assertEqual(actual.rstrip(), expected.rstrip()) + self.assertEqual(actual.strip(), expected.strip()) def test_inst_no_args(self): input = """ |