summaryrefslogtreecommitdiffstats
path: root/pym/portage_compat_namespace.py
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2008-02-28 14:55:51 +0000
committerMarius Mauch <genone@gentoo.org>2008-02-28 14:55:51 +0000
commit13dd0b4117189e03d2ac6a2243aa6d2d56f4ea3a (patch)
treee45192f9a923c53c380d20b9d1acb4b5bf7d0295 /pym/portage_compat_namespace.py
parentfe4a6ea3c2d778a2475737fb2284a35ad3796e9d (diff)
downloadportage-13dd0b4117189e03d2ac6a2243aa6d2d56f4ea3a.tar.gz
portage-13dd0b4117189e03d2ac6a2243aa6d2d56f4ea3a.tar.bz2
portage-13dd0b4117189e03d2ac6a2243aa6d2d56f4ea3a.zip
supress stupid line echo in deprecation notices
svn path=/main/trunk/; revision=9397
Diffstat (limited to 'pym/portage_compat_namespace.py')
-rw-r--r--pym/portage_compat_namespace.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/portage_compat_namespace.py b/pym/portage_compat_namespace.py
index 9e5e691a9..b6c3da569 100644
--- a/pym/portage_compat_namespace.py
+++ b/pym/portage_compat_namespace.py
@@ -31,5 +31,10 @@ try:
except ImportError, AttributeError:
raise ImportError("No module named %s" % __oldname)
-warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname))
+def _formatwarning(message, category, filename, lineno):
+ return "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message)
+
+warnings.formatwarning = _formatwarning
+
+warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname), DeprecationWarning)
sys.modules[__oldname] = __realmodule