Florent Xicluna <florent.xicl...@gmail.com> added the comment:

Btw, the comment and failure message in r81380/r81381 look wrong.

-    # If absolute import syntax is used, then do not try to perform
-    # a relative import in the face of failure.
+    # If explicit relative import syntax is used, then do not try
+    # to perform an absolute import in the face of failure.

     self.fail("explicit relative import triggered "
-              "an implicit relative import")
+              "an implicit absolute import")


In addition the TestCase.assertRaises method could be used:

    def test_absolute_import_without_future(self):
        # If explicit relative import syntax is used, then do not try
        # to perform a relative import in the face of failure.
        # Issue #7902.
        with self.assertRaises(ImportError):
            from .os import sep
            self.fail("explicit relative import triggered an "
                      "implicit absolute import")

----------
nosy: +flox

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7902>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to