This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author flox
Recipients Oren_Held, brett.cannon, flox, gangesmaster, loewis, meador.inge
Date 2010-08-16.15:17:55
SpamBayes Score 0.004310738
Marked as misclassified No
Message-id <1281971877.98.0.587739700369.issue7902@psf.upfronthosting.co.za>
In-reply-to
Content
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")
History
Date User Action Args
2010-08-16 15:17:58floxsetrecipients: + flox, loewis, brett.cannon, gangesmaster, meador.inge, Oren_Held
2010-08-16 15:17:57floxsetmessageid: <1281971877.98.0.587739700369.issue7902@psf.upfronthosting.co.za>
2010-08-16 15:17:55floxlinkissue7902 messages
2010-08-16 15:17:55floxcreate