diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-12-23 20:17:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-23 20:17:24 (GMT) |
commit | 745545b5bb847023f90505bf9caa983463413780 (patch) | |
tree | 1b6db7fc6c92542ac9bc56769524ee26ce9eb10e /Lib/xml | |
parent | c5726b727e26b81a267933654cf26b760a90d9aa (diff) | |
download | cpython-745545b5bb847023f90505bf9caa983463413780.zip cpython-745545b5bb847023f90505bf9caa983463413780.tar.gz cpython-745545b5bb847023f90505bf9caa983463413780.tar.bz2 |
gh-99482: remove `jython` compatibility parts from stdlib and tests (#99484)
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/sax/__init__.py | 21 | ||||
-rw-r--r-- | Lib/xml/sax/_exceptions.py | 4 | ||||
-rw-r--r-- | Lib/xml/sax/expatreader.py | 6 |
3 files changed, 4 insertions, 27 deletions
diff --git a/Lib/xml/sax/__init__.py b/Lib/xml/sax/__init__.py index 17b7587..b657310 100644 --- a/Lib/xml/sax/__init__.py +++ b/Lib/xml/sax/__init__.py @@ -60,11 +60,7 @@ if _false: import os, sys if not sys.flags.ignore_environment and "PY_SAX_PARSER" in os.environ: default_parser_list = os.environ["PY_SAX_PARSER"].split(",") -del os - -_key = "python.xml.sax.parser" -if sys.platform[:4] == "java" and sys.registry.containsKey(_key): - default_parser_list = sys.registry.getProperty(_key).split(",") +del os, sys def make_parser(parser_list=()): @@ -93,15 +89,6 @@ def make_parser(parser_list=()): # --- Internal utility methods used by make_parser -if sys.platform[ : 4] == "java": - def _create_parser(parser_name): - from org.python.core import imp - drv_module = imp.importName(parser_name, 0, globals()) - return drv_module.create_parser() - -else: - def _create_parser(parser_name): - drv_module = __import__(parser_name,{},{},['create_parser']) - return drv_module.create_parser() - -del sys +def _create_parser(parser_name): + drv_module = __import__(parser_name,{},{},['create_parser']) + return drv_module.create_parser() diff --git a/Lib/xml/sax/_exceptions.py b/Lib/xml/sax/_exceptions.py index a9b2ba3..f292dc3 100644 --- a/Lib/xml/sax/_exceptions.py +++ b/Lib/xml/sax/_exceptions.py @@ -1,8 +1,4 @@ """Different kinds of SAX Exceptions""" -import sys -if sys.platform[:4] == "java": - from java.lang import Exception -del sys # ===== SAXEXCEPTION ===== diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py index e334ac9..b9ad526 100644 --- a/Lib/xml/sax/expatreader.py +++ b/Lib/xml/sax/expatreader.py @@ -12,12 +12,6 @@ from xml.sax.handler import feature_external_ges, feature_external_pes from xml.sax.handler import feature_string_interning from xml.sax.handler import property_xml_string, property_interning_dict -# xml.parsers.expat does not raise ImportError in Jython -import sys -if sys.platform[:4] == "java": - raise SAXReaderNotAvailable("expat not available in Java", None) -del sys - try: from xml.parsers import expat except ImportError: |