From 650b60cc7eeb5ccbc9c9b05c344cdabfe721665f Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Tue, 1 Jun 2021 18:08:59 -0400 Subject: [PATCH] Remove namespace conflicts with `io` and `re` --- Lib/typing.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/typing.py b/Lib/typing.py index caa61289b..b87acd636 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1998,7 +1998,8 @@ class io: # XXX RustPython TODO: editable type.__name__ # io.__name__ = __name__ + '.io' -sys.modules[io.__name__] = io +# sys.modules[io.__name__] = io +sys.modules[__name__ + '.io'] = io Pattern = _alias(stdlib_re.Pattern, AnyStr) Match = _alias(stdlib_re.Match, AnyStr) @@ -2013,4 +2014,5 @@ class re: # XXX RustPython TODO: editable type.__name__ # re.__name__ = __name__ + '.re' -sys.modules[re.__name__] = re +# sys.modules[re.__name__] = re +sys.modules[__name__ + '.re'] = re