[Python-checkins] bpo-32872: Avoid regrtest compatibility issue with namespace packages. (GH-6276) (GH-6278)

Ned Deily webhook-mailer at python.org
Wed Mar 28 02:43:54 EDT 2018


https://github.com/python/cpython/commit/a93662cf8fb98e41f2b7e7c032b680eee834d290
commit: a93662cf8fb98e41f2b7e7c032b680eee834d290
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Ned Deily <nad at python.org>
date: 2018-03-28T02:43:51-04:00
summary:

bpo-32872: Avoid regrtest compatibility issue with namespace packages. (GH-6276) (GH-6278)

(cherry picked from commit e52ac045972a4f75d7f52e4ee0d6de128259134d)

Co-authored-by: Ned Deily <nad at python.org>

files:
A Misc/NEWS.d/next/Tests/2018-03-28-01-35-02.bpo-32872.J5NDUj.rst
M Lib/test/libregrtest/setup.py

diff --git a/Lib/test/libregrtest/setup.py b/Lib/test/libregrtest/setup.py
index bf899a9e4d4a..910aca1b1a6c 100644
--- a/Lib/test/libregrtest/setup.py
+++ b/Lib/test/libregrtest/setup.py
@@ -57,7 +57,7 @@ def setup_tests(ns):
         if hasattr(module, '__path__'):
             for index, path in enumerate(module.__path__):
                 module.__path__[index] = os.path.abspath(path)
-        if hasattr(module, '__file__'):
+        if getattr(module, '__file__', None):
             module.__file__ = os.path.abspath(module.__file__)
 
     # MacOSX (a.k.a. Darwin) has a default stack size that is too small
diff --git a/Misc/NEWS.d/next/Tests/2018-03-28-01-35-02.bpo-32872.J5NDUj.rst b/Misc/NEWS.d/next/Tests/2018-03-28-01-35-02.bpo-32872.J5NDUj.rst
new file mode 100644
index 000000000000..06d656bbfd64
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2018-03-28-01-35-02.bpo-32872.J5NDUj.rst
@@ -0,0 +1 @@
+Avoid regrtest compatibility issue with namespace packages.



More information about the Python-checkins mailing list