mirror of
https://github.com/python/cpython.git
synced 2026-04-05 03:21:05 +00:00
Whitespace normalization
This commit is contained in:
parent
eeff493426
commit
44dab0ab2f
15 changed files with 37 additions and 37 deletions
|
|
@ -107,7 +107,7 @@ def run_cgi(self):
|
|||
"""Execute a CGI script."""
|
||||
path = self.path
|
||||
dir, rest = self.cgi_info
|
||||
|
||||
|
||||
i = path.find('/', len(dir) + 1)
|
||||
while i >= 0:
|
||||
nextdir = path[:i]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ def ntransfercmd(self, cmd, rest=None):
|
|||
# 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 @@ def ntransfercmd(self, cmd, rest=None):
|
|||
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()
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ def __init__(self, parent, title = None):
|
|||
# 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)
|
||||
|
||||
|
|
|
|||
|
|
@ -596,7 +596,7 @@ def __init__(self, args, bufsize=0, executable=None,
|
|||
# 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 @@ def _communicate(self, input):
|
|||
# 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)
|
||||
|
|
|
|||
|
|
@ -921,7 +921,7 @@ def test_readlines(self):
|
|||
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')
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -1216,7 +1216,7 @@ class C(object):
|
|||
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 @@ class C(object):
|
|||
except (TypeError, UnicodeEncodeError):
|
||||
pass
|
||||
else:
|
||||
raise TestFailed, "[unichr(128)] slots not caught"
|
||||
raise TestFailed, "[unichr(128)] slots not caught"
|
||||
|
||||
# Test leaks
|
||||
class Counted(object):
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
# 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)
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
try:
|
||||
import infinite_reload
|
||||
finally:
|
||||
sys.path.pop(0)
|
||||
|
||||
test_infinite_reload()
|
||||
|
|
|
|||
|
|
@ -681,11 +681,11 @@ def dummy_factory (s):
|
|||
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 @@ def test_relock(self):
|
|||
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 @@ def test_get_folder(self):
|
|||
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 @@ def test_pack(self):
|
|||
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')
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ def setUp(self):
|
|||
|
||||
def tearDown(self):
|
||||
os.unlink(self._path)
|
||||
|
||||
|
||||
def test_from_regex (self):
|
||||
# Testing new regex from bug #1633678
|
||||
f = open(self._path, 'w')
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ def test_empty_array(self):
|
|||
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
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ def test_1463026_3():
|
|||
gen.endDocument()
|
||||
|
||||
return result.getvalue() == start+'<my:a xmlns:my="qux" b="c"></my:a>'
|
||||
|
||||
|
||||
# ===== Xmlfilterbase
|
||||
|
||||
def test_filter_basic():
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ def test_do_not_rehash_dict_keys(self):
|
|||
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 @@ def __init__(self, iterable=[], newarg=None):
|
|||
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,
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@
|
|||
... elif 1:
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
SyntaxError: can't assign to function call (<doctest test.test_syntax[44]>, line 2)
|
||||
|
||||
>>> if 1:
|
||||
|
|
@ -381,7 +381,7 @@
|
|||
... elif 1:
|
||||
... x() = 1
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
SyntaxError: can't assign to function call (<doctest test.test_syntax[45]>, line 4)
|
||||
|
||||
>>> if 1:
|
||||
|
|
@ -391,7 +391,7 @@
|
|||
... else:
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
SyntaxError: can't assign to function call (<doctest test.test_syntax[46]>, line 2)
|
||||
|
||||
>>> if 1:
|
||||
|
|
@ -401,7 +401,7 @@
|
|||
... else:
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
SyntaxError: can't assign to function call (<doctest test.test_syntax[47]>, line 4)
|
||||
|
||||
>>> if 1:
|
||||
|
|
@ -411,7 +411,7 @@
|
|||
... else:
|
||||
... x() = 1
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
SyntaxError: can't assign to function call (<doctest test.test_syntax[48]>, line 6)
|
||||
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue