gh-99482: remove jython compatibility parts from stdlib and tests (#99484)

This commit is contained in:
Nikita Sobolev 2022-12-23 23:17:24 +03:00 committed by GitHub
parent c5726b727e
commit 745545b5bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 134 additions and 232 deletions

View file

@ -505,6 +505,7 @@ def requires_debug_ranges(reason='requires co_positions / debug_ranges'):
requires_legacy_unicode_capi = unittest.skipUnless(unicode_legacy_string,
'requires legacy Unicode C API')
# Is not actually used in tests, but is kept for compatibility.
is_jython = sys.platform.startswith('java')
is_android = hasattr(sys, 'getandroidapilevel')
@ -736,8 +737,6 @@ def gc_collect():
"""
import gc
gc.collect()
if is_jython:
time.sleep(0.1)
gc.collect()
gc.collect()

View file

@ -11,11 +11,7 @@ import warnings
# Filename used for testing
if os.name == 'java':
# Jython disallows @ in module names
TESTFN_ASCII = '$test'
else:
TESTFN_ASCII = '@test'
TESTFN_ASCII = '@test'
# Disambiguate TESTFN for parallel testing, while letting it remain a valid
# module name.