diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-03-07 17:30:48 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-03-07 17:30:48 (GMT) |
commit | 669454e9dc4f8472b9239b4abdec1b7e111bb864 (patch) | |
tree | e5566ce903bf0f79dd1cd8292984a3b0a6d9ca6c | |
parent | bf7e241397165fdbe68c5119912bf64a52f0e3a0 (diff) | |
download | cpython-669454e9dc4f8472b9239b4abdec1b7e111bb864.zip cpython-669454e9dc4f8472b9239b4abdec1b7e111bb864.tar.gz cpython-669454e9dc4f8472b9239b4abdec1b7e111bb864.tar.bz2 |
Whitespace normalization.
-rw-r--r-- | Lib/compiler/transformer.py | 2 | ||||
-rw-r--r-- | Lib/dis.py | 78 | ||||
-rw-r--r-- | Lib/test/test_plistlib.py | 4 | ||||
-rw-r--r-- | Lib/test/test_ucn.py | 2 | ||||
-rw-r--r-- | Lib/test/test_unicodedata.py | 2 |
5 files changed, 44 insertions, 44 deletions
diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py index 337ef43..9038f7e 100644 --- a/Lib/compiler/transformer.py +++ b/Lib/compiler/transformer.py @@ -142,7 +142,7 @@ class Transformer: self.encoding = node[2] node = node[1] n = node[0] - + if n == symbol.single_input: return self.single_input(node[1:]) if n == symbol.file_input: @@ -131,45 +131,45 @@ def disassemble(co, lasti=-1): def disassemble_string(code, lasti=-1, varnames=None, names=None, constants=None): - labels = findlabels(code) - n = len(code) - i = 0 - while i < n: - c = code[i] - op = ord(c) - if op == opmap['SET_LINENO'] and i > 0: - print # Extra blank line - if i == lasti: print '-->', - else: print ' ', - if i in labels: print '>>', - else: print ' ', - print `i`.rjust(4), - print opname[op].ljust(15), - i = i+1 - if op >= HAVE_ARGUMENT: - oparg = ord(code[i]) + ord(code[i+1])*256 - i = i+2 - print `oparg`.rjust(5), - if op in hasconst: - if constants: - print '(' + `constants[oparg]` + ')', - else: - print '(%d)'%oparg, - elif op in hasname: - if names is not None: - print '(' + names[oparg] + ')', - else: - print '(%d)'%oparg, - elif op in hasjrel: - print '(to ' + `i + oparg` + ')', - elif op in haslocal: - if varnames: - print '(' + varnames[oparg] + ')', - else: - print '(%d)' % oparg, - elif op in hascompare: - print '(' + cmp_op[oparg] + ')', - print + labels = findlabels(code) + n = len(code) + i = 0 + while i < n: + c = code[i] + op = ord(c) + if op == opmap['SET_LINENO'] and i > 0: + print # Extra blank line + if i == lasti: print '-->', + else: print ' ', + if i in labels: print '>>', + else: print ' ', + print `i`.rjust(4), + print opname[op].ljust(15), + i = i+1 + if op >= HAVE_ARGUMENT: + oparg = ord(code[i]) + ord(code[i+1])*256 + i = i+2 + print `oparg`.rjust(5), + if op in hasconst: + if constants: + print '(' + `constants[oparg]` + ')', + else: + print '(%d)'%oparg, + elif op in hasname: + if names is not None: + print '(' + names[oparg] + ')', + else: + print '(%d)'%oparg, + elif op in hasjrel: + print '(to ' + `i + oparg` + ')', + elif op in haslocal: + if varnames: + print '(' + varnames[oparg] + ')', + else: + print '(%d)' % oparg, + elif op in hascompare: + print '(' + cmp_op[oparg] + ')', + print disco = disassemble # XXX For backwards compatibility diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py index bf070c7..75cd457 100644 --- a/Lib/test/test_plistlib.py +++ b/Lib/test/test_plistlib.py @@ -37,7 +37,7 @@ class TestPlistlib(unittest.TestCase): else: pl['aDate'] = plistlib.Date(time.mktime(time.gmtime())) return pl - + def test_create(self): pl = self._create() self.assertEqual(pl["aString"], "Doodah") @@ -47,7 +47,7 @@ class TestPlistlib(unittest.TestCase): pl = self._create() pl.write(test_support.TESTFN) pl2 = plistlib.Plist.fromFile(test_support.TESTFN) - self.assertEqual(dict(pl), dict(pl2)) + self.assertEqual(dict(pl), dict(pl2)) diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py index a3cda10..d1fa35b 100644 --- a/Lib/test/test_ucn.py +++ b/Lib/test/test_ucn.py @@ -15,7 +15,7 @@ class UnicodeNamesTest(unittest.TestCase): def checkletter(self, name, code): # Helper that put all \N escapes inside eval'd raw strings, - # to make sure this script runs even if the compiler + # to make sure this script runs even if the compiler # chokes on \N escapes res = eval(ur'u"\N{%s}"' % name) self.assertEqual(res, code) diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py index 95077c3..a3a5fbc 100644 --- a/Lib/test/test_unicodedata.py +++ b/Lib/test/test_unicodedata.py @@ -191,7 +191,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest): def test_digit_numeric_consistent(self): # Test that digit and numeric are consistent, - # i.e. if a character has a digit value, + # i.e. if a character has a digit value, # it's numeric value should be the same. count = 0 for i in xrange(0x10000): |