Skip to content

Commit e71dfff

Browse files
Rename sys to _sys and proxy it.
1 parent 8239fd7 commit e71dfff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1444
-97
lines changed

Lib/_collections_abc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88

99
from abc import ABCMeta, abstractmethod
10-
import sys
10+
import _sys as sys # We use the low-level module during interpreter init.
1111

1212
__all__ = ["Awaitable", "Coroutine",
1313
"AsyncIterable", "AsyncIterator", "AsyncGenerator",

Lib/_compat_pickle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
NAME_MAPPING = {
5858
('__builtin__', 'xrange'): ('builtins', 'range'),
5959
('__builtin__', 'reduce'): ('functools', 'reduce'),
60-
('__builtin__', 'intern'): ('sys', 'intern'),
60+
('__builtin__', 'intern'): ('_sys', 'intern'),
6161
('__builtin__', 'unichr'): ('builtins', 'chr'),
6262
('__builtin__', 'unicode'): ('builtins', 'str'),
6363
('__builtin__', 'long'): ('builtins', 'int'),

Lib/_sitebuiltins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Note this means this module should also avoid keep things alive in its
99
# globals.
1010

11-
import sys
11+
import _sys as sys # We use the low-level module during interpreter init.
1212

1313
class Quitter(object):
1414
def __init__(self, name, eof):

Lib/codecs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010
import builtins
11-
import sys
11+
import _sys as sys # We use the low-level module during interpreter init.
1212

1313
### Registry and builtin stateless codec functions
1414

Lib/collections/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
from operator import itemgetter as _itemgetter, eq as _eq
2727
from keyword import iskeyword as _iskeyword
28-
import sys as _sys
28+
import _sys # We use the low-level module during interpreter init.
2929
import heapq as _heapq
3030
from _weakref import proxy as _proxy
3131
from itertools import repeat as _repeat, chain as _chain, starmap as _starmap

Lib/contextlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Utilities for with-statement contexts. See PEP 343."""
22
import abc
3-
import sys
3+
import _sys as sys
44
import _collections_abc
55
from collections import deque
66
from functools import wraps

Lib/doctest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def _normalize_module(module, depth=2):
209209
elif module is None:
210210
return sys.modules[sys._getframe(depth).f_globals['__name__']]
211211
else:
212-
raise TypeError("Expected a module, string, or None")
212+
raise TypeError("Expected a module, string, or None, got {}".format(type(module)))
213213

214214
def _load_testfile(filename, package, module_relative, encoding):
215215
if module_relative:

Lib/encodings/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"""#"
3030

3131
import codecs
32-
import sys
32+
import _sys as sys
3333
from . import aliases
3434

3535
_cache = {}

Lib/enum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import sys
1+
import _sys as sys
22
from types import MappingProxyType, DynamicClassAttribute
33
from functools import reduce
44
from operator import or_ as _or_

Lib/importlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# of a fully initialised version (either the frozen one or the one
1111
# initialised below if the frozen one is not available).
1212
import _imp # Just the builtin component, NOT the full Python module
13-
import sys
13+
import _sys as sys
1414

1515
try:
1616
import _frozen_importlib as _bootstrap

0 commit comments

Comments
 (0)