Inside _showwarning(), import sys since otherwise it's None for some reason.
authorZac Medico <zmedico@gentoo.org>
Mon, 29 Dec 2008 03:05:07 +0000 (03:05 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 29 Dec 2008 03:05:07 +0000 (03:05 -0000)
svn path=/main/trunk/; revision=12364

pym/portage_compat_namespace.py

index 6956ec2b31ab4ad833706bbec5f47113e602aebe..736b67833535b4374c8706cf9d47b1b2f21aae9f 100644 (file)
@@ -33,6 +33,7 @@ except (ImportError, AttributeError):
 
 def _showwarning(message, category, filename, lineno, file=None, line=None):
        if file is None:
+               import sys
                file = sys.stderr
        try:
                file.write("%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message))