diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index 28b7ea01a060c5..773bb037eb597c 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -818,7 +818,7 @@ def test_cwd_script_shadowing_stdlib(self): collections.does_not_exist def test_shadowing_stdlib_sys_edge_cases(self): - program = textwrap.dedent(''' + program = ''' import collections import os import types @@ -845,7 +845,7 @@ class substr(str): collections.does_not_exist except AttributeError as e: print(str(e)) -''') +''' popen = script_helper.spawn_python('-c', program) stdout, stderr = popen.communicate() self.assertEqual(stdout.splitlines(), [ diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 2f32f30232cb6a..45e0639799cd68 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -853,7 +853,7 @@ _Py_module_getattro_impl(PyModuleObject *m, PyObject *name, int suppress) } } - int is_script_shadowing_stdlib = 0; + bool is_script_shadowing_stdlib = 0; // Check mod.__name__ in sys.stdlib_module_names // and os.path.dirname(mod.__spec__.origin) == os.getcwd() if (origin) { @@ -862,7 +862,7 @@ _Py_module_getattro_impl(PyModuleObject *m, PyObject *name, int suppress) int rc = PySet_Contains(stdlib, mod_name); if (rc == 1) { wchar_t cwd[MAXPATHLEN], origin_dirname[MAXPATHLEN]; - if(_Py_wgetcwd(cwd, MAXPATHLEN)) { + if (_Py_wgetcwd(cwd, MAXPATHLEN)) { if (PyUnicode_AsWideChar(origin, origin_dirname, MAXPATHLEN) < 0) { goto done; }