Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a check for post-load m_copy.
  • Loading branch information
ericsnowcurrently committed Feb 15, 2023
commit c5aced3af62cd7545e5f19ec003e52f7a08ca57e
8 changes: 7 additions & 1 deletion Lib/test/test_imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,19 @@ def clean_up():
script = textwrap.dedent(f'''
import _testsinglephase

expected = %d
init_count = _testsinglephase.initialized_count()
if init_count != %d:
if init_count != expected:
raise Exception(init_count)

lookedup = _testsinglephase.look_up_self()
if lookedup is not _testsinglephase:
raise Exception((_testsinglephase, lookedup))

# Attrs set after loading are not in m_copy.
if hasattr(_testsinglephase, 'spam'):
raise Exception(_testsinglephase.spam)
_testsinglephase.spam = expected
''')

# Use an interpreter that gets destroyed right away.
Expand Down