Merge pull request #1956 from PeterJCLaw/python-3.12

Support Python 3.12
This commit is contained in:
Dave Halter
2023-09-17 19:25:45 +00:00
committed by GitHub
8 changed files with 18 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
from textwrap import dedent
import sys
import math
from collections import Counter
from datetime import datetime
@@ -26,7 +27,10 @@ def test_builtin_loading(inference_state):
assert not from_name.py__doc__() # It's a stub
def test_next_docstr(inference_state):
def test_next_docstr(inference_state, environment):
if environment.version_info[:2] != sys.version_info[:2]:
pytest.skip()
next_ = compiled.builtin_from_name(inference_state, 'next')
assert next_.tree_node is not None
assert next_.py__doc__() == '' # It's a stub

View File

@@ -13,7 +13,8 @@ from ..helpers import get_example_dir
'code, sig, names, op, version', [
('import math; math.cos', 'cos(x, /)', ['x'], ge, (3, 6)),
('next', 'next(iterator, default=None, /)', ['iterator', 'default'], ge, (3, 6)),
('next', 'next(iterator, default=None, /)', ['iterator', 'default'], lt, (3, 12)),
('next', 'next()', [], ge, (3, 12)),
('str', "str(object='', /) -> str", ['object'], ge, (3, 6)),

View File

@@ -81,7 +81,7 @@ class TestSetupReadline(unittest.TestCase):
if all(not x.startswith('from os import ' + s)
for s in ['_', 'O_', 'EX_', 'MFD_', 'SF_', 'ST_',
'CLD_', 'POSIX_SPAWN_', 'P_', 'RWF_',
'SCHED_'])
'CLONE_', 'SCHED_'])
}
# There are quite a few differences, because both Windows and Linux
# (posix and nt) libraries are included.