]> granicus.if.org Git - python/commitdiff
Whitespace normalization.
authorTim Peters <tim.peters@gmail.com>
Fri, 7 Mar 2003 17:30:48 +0000 (17:30 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 7 Mar 2003 17:30:48 +0000 (17:30 +0000)
Lib/compiler/transformer.py
Lib/dis.py
Lib/test/test_plistlib.py
Lib/test/test_ucn.py
Lib/test/test_unicodedata.py

index 337ef438b469c121fc77ec55bf1896c1fa38e7e7..9038f7efaac790e585528d425f7ceb069f92eb18 100644 (file)
@@ -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:
index a2c63ca940977b64b108667de4b7e91a432de2a5..f878d11ab911f1bdcf5883c523fcc3d1df3ee0ff 100644 (file)
@@ -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
 
index bf070c78f1c7ed0bd5ca4f0b2ec83e836037631e..75cd45717423baf67625c38b63ca33bcaa1ceffd 100644 (file)
@@ -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))
 
 
 
index a3cda106fc595fa93e0c4c028f1a5ad3216a253f..d1fa35b17435b74ff86448a5be91b1f7cbeb132e 100644 (file)
@@ -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)
index 95077c302e9184de09cfafc13200483f8e354c54..a3a5fbc97210abcc10cbd2c02c0a06a81871d87c 100644 (file)
@@ -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):