From 44dab0ab2fdbf8211336259aa7c7d5ea8bf79035 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Wed, 25 Apr 2007 06:42:41 +0000 Subject: [PATCH] Whitespace normalization --- Lib/CGIHTTPServer.py | 2 +- Lib/distutils/unixccompiler.py | 2 +- Lib/ftplib.py | 4 ++-- Lib/lib-tk/tkSimpleDialog.py | 4 ++-- Lib/subprocess.py | 4 ++-- Lib/test/test_codecs.py | 2 +- Lib/test/test_curses.py | 2 +- Lib/test/test_descr.py | 4 ++-- Lib/test/test_import.py | 16 ++++++++-------- Lib/test/test_mailbox.py | 14 +++++++------- Lib/test/test_old_mailbox.py | 2 +- Lib/test/test_re.py | 2 +- Lib/test/test_sax.py | 2 +- Lib/test/test_set.py | 6 +++--- Lib/test/test_syntax.py | 10 +++++----- 15 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py index c119c9a693..88613ad200 100644 --- a/Lib/CGIHTTPServer.py +++ b/Lib/CGIHTTPServer.py @@ -107,7 +107,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): """Execute a CGI script.""" path = self.path dir, rest = self.cgi_info - + i = path.find('/', len(dir) + 1) while i >= 0: nextdir = path[:i] diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index d1fd1d9511..75e8a5316e 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -82,7 +82,7 @@ def _darwin_compiler_fixup(compiler_so, cc_args): except ValueError: pass - # Check if the SDK that is used during compilation actually exists, + # Check if the SDK that is used during compilation actually exists, # the universal build requires the usage of a universal SDK and not all # users have that installed by default. sysroot = None diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 9cb67dd556..9dce22b35b 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -332,7 +332,7 @@ class FTP: # 1xx or error messages for LIST), so we just discard # this response. if resp[0] == '2': - resp = self.getresp() + resp = self.getresp() if resp[0] != '1': raise error_reply, resp else: @@ -342,7 +342,7 @@ class FTP: resp = self.sendcmd(cmd) # See above. if resp[0] == '2': - resp = self.getresp() + resp = self.getresp() if resp[0] != '1': raise error_reply, resp conn, sockaddr = sock.accept() diff --git a/Lib/lib-tk/tkSimpleDialog.py b/Lib/lib-tk/tkSimpleDialog.py index 445048440a..03475f4060 100644 --- a/Lib/lib-tk/tkSimpleDialog.py +++ b/Lib/lib-tk/tkSimpleDialog.py @@ -50,9 +50,9 @@ class Dialog(Toplevel): # If the master is not viewable, don't # make the child transient, or else it # would be opened withdrawn - if parent.winfo_viewable(): + if parent.winfo_viewable(): self.transient(parent) - + if title: self.title(title) diff --git a/Lib/subprocess.py b/Lib/subprocess.py index ee9b4a2082..1e3d84b632 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -596,7 +596,7 @@ class Popen(object): # either have to redirect all three or none. If the subprocess # user has only redirected one or two handles, we are # automatically creating PIPEs for the rest. We should close - # these after the process is started. See bug #1124861. + # these after the process is started. See bug #1124861. if mswindows: if stdin is None and p2cwrite is not None: os.close(p2cwrite) @@ -1142,7 +1142,7 @@ class Popen(object): # we can write up to PIPE_BUF bytes without risk # blocking. POSIX defines PIPE_BUF >= 512 bytes_written = os.write(self.stdin.fileno(), buffer(input, input_offset, 512)) - input_offset += bytes_written + input_offset += bytes_written if input_offset >= len(input): self.stdin.close() write_set.remove(self.stdin) diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index 8c2a979923..6d6e37897d 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -921,7 +921,7 @@ class StreamReaderTest(unittest.TestCase): self.assertEquals(f.readlines(), [u'\ud55c\n', u'\uae00']) class EncodedFileTest(unittest.TestCase): - + def test_basic(self): f = StringIO.StringIO('\xed\x95\x9c\n\xea\xb8\x80') ef = codecs.EncodedFile(f, 'utf-16-le', 'utf-8') diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index ff7b39d11f..b67dbe368d 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -245,7 +245,7 @@ def test_resize_term(stdscr): if hasattr(curses, 'resizeterm'): lines, cols = curses.LINES, curses.COLS curses.resizeterm(lines - 1, cols + 1) - + if curses.LINES != lines - 1 or curses.COLS != cols + 1: raise RuntimeError, "Expected resizeterm to update LINES and COLS" diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index a29f404f5f..a9ee5bcab6 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1216,7 +1216,7 @@ def slots(): except NameError: pass else: - # _unicode_to_string used to modify slots in certain circumstances + # _unicode_to_string used to modify slots in certain circumstances slots = (unicode("foo"), unicode("bar")) class C(object): __slots__ = slots @@ -1231,7 +1231,7 @@ def slots(): except (TypeError, UnicodeEncodeError): pass else: - raise TestFailed, "[unichr(128)] slots not caught" + raise TestFailed, "[unichr(128)] slots not caught" # Test leaks class Counted(object): diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index ed97f84fef..eee147e385 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -224,13 +224,13 @@ def test_import_initless_directory_warning(): test_import_initless_directory_warning() def test_infinite_reload(): - # Bug #742342 reports that Python segfaults (infinite recursion in C) - # when faced with self-recursive reload()ing. - - sys.path.insert(0, os.path.dirname(__file__)) - try: - import infinite_reload - finally: - sys.path.pop(0) + # Bug #742342 reports that Python segfaults (infinite recursion in C) + # when faced with self-recursive reload()ing. + + sys.path.insert(0, os.path.dirname(__file__)) + try: + import infinite_reload + finally: + sys.path.pop(0) test_infinite_reload() diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index 264e237221..18e6b67742 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -681,11 +681,11 @@ class TestMaildir(TestMailbox): box = self._factory(self._path, factory=dummy_factory) folder = box.add_folder('folder1') self.assert_(folder._factory is dummy_factory) - + folder1_alias = box.get_folder('folder1') self.assert_(folder1_alias._factory is dummy_factory) - + class _TestMboxMMDF(TestMailbox): @@ -767,15 +767,15 @@ class _TestMboxMMDF(TestMailbox): key1 = self._box.add(msg) self._box.flush() self._box.close() - + self._box = self._factory(self._path) self._box.lock() key2 = self._box.add(msg) self._box.flush() self.assert_(self._box._locked) self._box.close() - - + + class TestMbox(_TestMboxMMDF): @@ -805,7 +805,7 @@ class TestMH(TestMailbox): def dummy_factory (s): return None self._box = self._factory(self._path, dummy_factory) - + new_folder = self._box.add_folder('foo.bar') folder0 = self._box.get_folder('foo.bar') folder0.add(self._template % 'bar') @@ -901,7 +901,7 @@ class TestMH(TestMailbox): self.assert_(self._box.get_sequences() == {'foo':[1, 2, 3, 4, 5], 'unseen':[1], 'bar':[3], 'replied':[3]}) - + def _get_lock_path(self): return os.path.join(self._path, '.mh_sequences.lock') diff --git a/Lib/test/test_old_mailbox.py b/Lib/test/test_old_mailbox.py index c8f6bac64b..7bd555758a 100644 --- a/Lib/test/test_old_mailbox.py +++ b/Lib/test/test_old_mailbox.py @@ -116,7 +116,7 @@ class MboxTestCase(unittest.TestCase): def tearDown(self): os.unlink(self._path) - + def test_from_regex (self): # Testing new regex from bug #1633678 f = open(self._path, 'w') diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index f15ce09fb5..08f28f0707 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -610,7 +610,7 @@ class ReTests(unittest.TestCase): for typecode in 'cbBuhHiIlLfd': a = array.array(typecode) self.assertEqual(re.compile("bla").match(a), None) - self.assertEqual(re.compile("").match(a).groups(), ()) + self.assertEqual(re.compile("").match(a).groups(), ()) def run_re_tests(): from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py index 2191f325c5..bb5e54920a 100644 --- a/Lib/test/test_sax.py +++ b/Lib/test/test_sax.py @@ -252,7 +252,7 @@ def test_1463026_3(): gen.endDocument() return result.getvalue() == start+'' - + # ===== Xmlfilterbase def test_filter_basic(): diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index ef7cea7be1..872a467a55 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -288,7 +288,7 @@ class TestJointOps(unittest.TestCase): self.assertEqual(sum(elem.hash_count for elem in d), n) if hasattr(s, 'symmetric_difference_update'): s.symmetric_difference_update(d) - self.assertEqual(sum(elem.hash_count for elem in d), n) + self.assertEqual(sum(elem.hash_count for elem in d), n) d2 = dict.fromkeys(set(d)) self.assertEqual(sum(elem.hash_count for elem in d), n) d3 = dict.fromkeys(frozenset(d)) @@ -500,7 +500,7 @@ class SetSubclassWithKeywordArgs(set): set.__init__(self, iterable) class TestSetSubclassWithKeywordArgs(TestSet): - + def test_keywords_in_subclass(self): 'SF bug #1486663 -- this used to erroneously raise a TypeError' SetSubclassWithKeywordArgs(newarg=1) @@ -1487,7 +1487,7 @@ def test_main(verbose=None): test_classes = ( TestSet, TestSetSubclass, - TestSetSubclassWithKeywordArgs, + TestSetSubclassWithKeywordArgs, TestFrozenSet, TestFrozenSetSubclass, TestSetOfSets, diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index ef8e9a24c6..ff97470193 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -373,7 +373,7 @@ leading to spurious errors. ... elif 1: ... pass Traceback (most recent call last): - ... + ... SyntaxError: can't assign to function call (, line 2) >>> if 1: @@ -381,7 +381,7 @@ leading to spurious errors. ... elif 1: ... x() = 1 Traceback (most recent call last): - ... + ... SyntaxError: can't assign to function call (, line 4) >>> if 1: @@ -391,7 +391,7 @@ leading to spurious errors. ... else: ... pass Traceback (most recent call last): - ... + ... SyntaxError: can't assign to function call (, line 2) >>> if 1: @@ -401,7 +401,7 @@ leading to spurious errors. ... else: ... pass Traceback (most recent call last): - ... + ... SyntaxError: can't assign to function call (, line 4) >>> if 1: @@ -411,7 +411,7 @@ leading to spurious errors. ... else: ... x() = 1 Traceback (most recent call last): - ... + ... SyntaxError: can't assign to function call (, line 6) """ -- 2.40.0