mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix some more has_key() uses. This could really use a tool to automate...
This commit is contained in:
parent
5c303dec17
commit
1b01e5c706
6 changed files with 18 additions and 21 deletions
|
@ -59,7 +59,7 @@ if _false:
|
|||
import xml.sax.expatreader
|
||||
|
||||
import os, sys
|
||||
if os.environ.has_key("PY_SAX_PARSER"):
|
||||
if "PY_SAX_PARSER" in os.environ:
|
||||
default_parser_list = os.environ["PY_SAX_PARSER"].split(",")
|
||||
del os
|
||||
|
||||
|
@ -81,7 +81,7 @@ def make_parser(parser_list = []):
|
|||
return _create_parser(parser_name)
|
||||
except ImportError,e:
|
||||
import sys
|
||||
if sys.modules.has_key(parser_name):
|
||||
if parser_name in sys.modules:
|
||||
# The parser module was found, but importing it
|
||||
# failed unexpectedly, pass this exception through
|
||||
raise
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue