1 |
Author: genone |
2 |
Date: 2008-02-28 14:55:51 +0000 (Thu, 28 Feb 2008) |
3 |
New Revision: 9397 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage_compat_namespace.py |
7 |
Log: |
8 |
supress stupid line echo in deprecation notices |
9 |
|
10 |
Modified: main/trunk/pym/portage_compat_namespace.py |
11 |
=================================================================== |
12 |
--- main/trunk/pym/portage_compat_namespace.py 2008-02-28 13:12:52 UTC (rev 9396) |
13 |
+++ main/trunk/pym/portage_compat_namespace.py 2008-02-28 14:55:51 UTC (rev 9397) |
14 |
@@ -31,5 +31,10 @@ |
15 |
except ImportError, AttributeError: |
16 |
raise ImportError("No module named %s" % __oldname) |
17 |
|
18 |
-warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) |
19 |
+def _formatwarning(message, category, filename, lineno): |
20 |
+ return "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message) |
21 |
+ |
22 |
+warnings.formatwarning = _formatwarning |
23 |
+ |
24 |
+warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname), DeprecationWarning) |
25 |
sys.modules[__oldname] = __realmodule |
26 |
|
27 |
-- |
28 |
gentoo-commits@l.g.o mailing list |