summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-09-17 19:22:41 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2016-09-17 19:22:41 (GMT)
commit313523ce2dd67db67b7dcbcc5f6d6ca95922b34b (patch)
tree0ebcad214cf25fb898023da2011dcc5183942ca0 /Lib/site.py
parentd2154ab0b728c8b5f5ec44d3496e8760a0504581 (diff)
downloadcpython-313523ce2dd67db67b7dcbcc5f6d6ca95922b34b.zip
cpython-313523ce2dd67db67b7dcbcc5f6d6ca95922b34b.tar.gz
cpython-313523ce2dd67db67b7dcbcc5f6d6ca95922b34b.tar.bz2
Issue #28192: Don't import readline in isolated mode
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/site.py b/Lib/site.py
index 5250266..b637635 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -60,7 +60,8 @@ omitted because it is not mentioned in either path configuration file.
The readline module is also automatically configured to enable
completion for systems that support it. This can be overridden in
-sitecustomize, usercustomize or PYTHONSTARTUP.
+sitecustomize, usercustomize or PYTHONSTARTUP. Starting Python in
+isolated mode (-I) disables automatic readline configuration.
After these operations, an attempt is made to import a module
named sitecustomize, which can perform arbitrary additional
@@ -491,7 +492,7 @@ def execsitecustomize():
else:
raise
except Exception as err:
- if os.environ.get("PYTHONVERBOSE"):
+ if sys.flags.verbose:
sys.excepthook(*sys.exc_info())
else:
sys.stderr.write(
@@ -511,7 +512,7 @@ def execusercustomize():
else:
raise
except Exception as err:
- if os.environ.get("PYTHONVERBOSE"):
+ if sys.flags.verbose:
sys.excepthook(*sys.exc_info())
else:
sys.stderr.write(
@@ -538,12 +539,13 @@ def main():
setquit()
setcopyright()
sethelper()
- enablerlcompleter()
+ if not sys.flags.isolated:
+ enablerlcompleter()
execsitecustomize()
if ENABLE_USER_SITE:
execusercustomize()
-# Prevent edition of sys.path when python was started with -S and
+# Prevent extending of sys.path when python was started with -S and
# site is imported later.
if not sys.flags.no_site:
main()