diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-08-23 22:42:55 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-08-23 22:42:55 (GMT) |
commit | dd50cb748a4dc317891a8df50adc8371db7598cc (patch) | |
tree | dd7aec30f8fac7d30245339347b2d6d77ecd645c /Lib | |
parent | 4de7c5c10365edda9ee0cbf42cfa6a2e62118ba5 (diff) | |
download | cpython-dd50cb748a4dc317891a8df50adc8371db7598cc.zip cpython-dd50cb748a4dc317891a8df50adc8371db7598cc.tar.gz cpython-dd50cb748a4dc317891a8df50adc8371db7598cc.tar.bz2 |
The attempt to shut up deprecation warnings for doctest's own use of
is_private in its tests failed if doctest.py was run directly. Now
it works.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/doctest.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index 3fe837b..43f21b2 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -220,6 +220,11 @@ import unittest, difflib, pdb, tempfile import warnings from StringIO import StringIO +# Don't whine about the deprecated is_private function in this +# module's tests. +warnings.filterwarnings("ignore", "is_private", DeprecationWarning, + __name__, 0) + real_pdb_set_trace = pdb.set_trace # There are 4 basic classes: @@ -287,8 +292,6 @@ def is_private(prefix, base): Return true iff base begins with an (at least one) underscore, but does not both begin and end with (at least) two underscores. - >>> warnings.filterwarnings("ignore", "is_private", DeprecationWarning, - ... "doctest", 0) >>> is_private("a.b", "my_func") False >>> is_private("____", "_my_func") |