From 6578dc925ff0a7953ae50c7ac41a81b0bd54762e Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Tue, 24 Dec 2002 18:31:27 +0000 Subject: [PATCH] Whitespace normalization. --- Lib/email/_compat21.py | 2 +- Lib/encodings/__init__.py | 2 +- Lib/test/test_datetime.py | 2 +- Lib/test/test_descr.py | 10 +++++----- Lib/test/test_macpath.py | 1 - Lib/test/test_ntpath.py | 2 +- Lib/test/test_shelve.py | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Lib/email/_compat21.py b/Lib/email/_compat21.py index de8c44753de436..d220723793a0eb 100644 --- a/Lib/email/_compat21.py +++ b/Lib/email/_compat21.py @@ -31,7 +31,7 @@ def _floordiv(i, j): def _isstring(obj): - return isinstance(obj, StringType) or isinstance(obj, UnicodeType) + return isinstance(obj, StringType) or isinstance(obj, UnicodeType) diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py index b2542b8bd745e2..66bea5c06846d2 100644 --- a/Lib/encodings/__init__.py +++ b/Lib/encodings/__init__.py @@ -46,7 +46,7 @@ def normalize_encoding(encoding): characters except the dot used for Python package names are collapsed and replaced with a single underscore, e.g. ' -;#' becomes '_'. - + """ return '_'.join(_norm_encoding_RE.split(encoding)) diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py index fe522124800886..25c77162250547 100644 --- a/Lib/test/test_datetime.py +++ b/Lib/test/test_datetime.py @@ -2258,7 +2258,7 @@ def test_tzinfo_isoformat(self): cls = self.theclass datestr = '0001-02-03' for ofs in None, zero, plus, minus, unknown: - for us in 0, 987001: + for us in 0, 987001: d = cls(1, 2, 3, 4, 5, 59, us, tzinfo=ofs) timestr = '04:05:59' + (us and '.987001' or '') ofsstr = ofs is not None and d.tzname() or '' diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 0f656c244229aa..8d36fd5b39a2a9 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -3447,7 +3447,7 @@ def __getattribute__(self, attr): if attr == 'a': return 2 else: - return super(C2, self).__getattribute__(attr) + return super(C2, self).__getattribute__(attr) def meth(self): return 1 class D(C): @@ -3576,7 +3576,7 @@ class G(D): # Immediate subclasses have their mro's adjusted in alphabetical # order, so E's will get adjusted before adjusting F's fails. We # check here that E's gets restored. - + E_mro_before = E.__mro__ D_mro_before = D.__mro__ @@ -3610,20 +3610,20 @@ class E(C, D): pass else: raise TestFailed, "didn't catch MRO conflict" - + def mutable_names(): class C(object): pass # C.__module__ could be 'test_descr' or '__main__' mod = C.__module__ - + C.__name__ = 'D' vereq((C.__module__, C.__name__), (mod, 'D')) C.__name__ = 'D.E' vereq((C.__module__, C.__name__), (mod, 'D.E')) - + def test_main(): do_this_first() diff --git a/Lib/test/test_macpath.py b/Lib/test/test_macpath.py index 67b1bedbbc1fa2..3a3cf04c8b160b 100644 --- a/Lib/test/test_macpath.py +++ b/Lib/test/test_macpath.py @@ -61,4 +61,3 @@ def test_main(): if __name__ == "__main__": test_main() - diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index 2419844e418f43..fdb431aa6413cd 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -15,7 +15,7 @@ def tester(fn, wantResult): print " returned: " + str(gotResult) print "" errors = errors + 1 - + tester('ntpath.splitext("foo.ext")', ('foo', '.ext')) tester('ntpath.splitext("/foo/foo.ext")', ('/foo/foo', '.ext')) tester('ntpath.splitext(".ext")', ('', '.ext')) diff --git a/Lib/test/test_shelve.py b/Lib/test/test_shelve.py index 29af82eab0439f..e69e311ed9cf26 100644 --- a/Lib/test/test_shelve.py +++ b/Lib/test/test_shelve.py @@ -7,7 +7,7 @@ class TestCase(unittest.TestCase): fn = "shelftemp.db" - + def test_ascii_file_shelf(self): try: s = shelve.open(self.fn, binary=False)