1 |
Author: zmedico |
2 |
Date: 2010-02-19 11:00:14 +0000 (Fri, 19 Feb 2010) |
3 |
New Revision: 15392 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/dep.py |
7 |
Log: |
8 |
Bug #303519 - Call warnings.warn() with stacklevel=2 inside dep_getkey and |
9 |
dep_getcpv so that the caller is displayed. |
10 |
|
11 |
|
12 |
Modified: main/trunk/pym/portage/dep.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/portage/dep.py 2010-02-19 10:30:25 UTC (rev 15391) |
15 |
+++ main/trunk/pym/portage/dep.py 2010-02-19 11:00:14 UTC (rev 15392) |
16 |
@@ -708,7 +708,7 @@ |
17 |
# Fall back to legacy code for backward compatibility. |
18 |
warnings.warn(_("%s is deprecated, use %s instead") % \ |
19 |
('portage.dep.dep_getcpv()', 'portage.dep.Atom.cpv'), |
20 |
- DeprecationWarning) |
21 |
+ DeprecationWarning, stacklevel=2) |
22 |
mydep_orig = mydep |
23 |
if mydep: |
24 |
mydep = remove_slot(mydep) |
25 |
@@ -943,13 +943,13 @@ |
26 |
else: |
27 |
warnings.warn(_("invalid input to %s: '%s', use %s instead") % \ |
28 |
('portage.dep.dep_getkey()', mydep, 'portage.cpv_getkey()'), |
29 |
- DeprecationWarning) |
30 |
+ DeprecationWarning, stacklevel=2) |
31 |
return atom.cp |
32 |
|
33 |
# Fall back to legacy code for backward compatibility. |
34 |
warnings.warn(_("%s is deprecated, use %s instead") % \ |
35 |
('portage.dep.dep_getkey()', 'portage.dep.Atom.cp'), |
36 |
- DeprecationWarning) |
37 |
+ DeprecationWarning, stacklevel=2) |
38 |
mydep = dep_getcpv(mydep) |
39 |
if mydep and isspecific(mydep): |
40 |
mysplit = catpkgsplit(mydep) |