diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-03-29 04:36:09 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-03-29 04:36:09 (GMT) |
commit | a19a168cccbc61b2a002475dd3b966b50983003e (patch) | |
tree | b1cd5ae6e193619ac8fecc99652813304a4873f0 /Lib | |
parent | 301ab7f2d0ae11087512ef3a36beaf4edc3efa0a (diff) | |
download | cpython-a19a168cccbc61b2a002475dd3b966b50983003e.zip cpython-a19a168cccbc61b2a002475dd3b966b50983003e.tar.gz cpython-a19a168cccbc61b2a002475dd3b966b50983003e.tar.bz2 |
Whitespace normalization.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/socket.py | 2 | ||||
-rw-r--r-- | Lib/symtable.py | 8 | ||||
-rw-r--r-- | Lib/test/test_pty.py | 2 | ||||
-rw-r--r-- | Lib/test/test_zipfile.py | 8 | ||||
-rw-r--r-- | Lib/traceback.py | 2 | ||||
-rw-r--r-- | Lib/unittest.py | 14 | ||||
-rw-r--r-- | Lib/zipfile.py | 10 |
7 files changed, 23 insertions, 23 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index 7cd7889..d0f0911 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -63,7 +63,7 @@ if (sys.platform.lower().startswith("win") def ssl(sock, keyfile=None, certfile=None): if hasattr(sock, "_sock"): sock = sock._sock - return _realsslcall(sock, keyfile, certfile) + return _realsslcall(sock, keyfile, certfile) # WSA error codes diff --git a/Lib/symtable.py b/Lib/symtable.py index 6401d51..135cd56 100644 --- a/Lib/symtable.py +++ b/Lib/symtable.py @@ -34,7 +34,7 @@ class SymbolTableFactory: return obj newSymbolTable = SymbolTableFactory() - + def bool(x): """Helper to force boolean result to 1 or 0""" if x: @@ -60,7 +60,7 @@ class SymbolTable: kind = "" else: kind = "%s " % self.__class__.__name__ - + if self._table.name == "global": return "<%sSymbolTable for module %s>" % (kind, self._filename) else: @@ -143,7 +143,7 @@ class Function(SymbolTable): if self.__locals is None: self.__locals = self.__idents_matching(lambda x:x & DEF_BOUND) return self.__locals - + def get_globals(self): if self.__globals is None: glob = DEF_GLOBAL | DEF_FREE_GLOBAL @@ -186,7 +186,7 @@ class Symbol: return bool(self.__flags & DEF_PARAM) def is_global(self): - return bool((self.__flags & DEF_GLOBAL) + return bool((self.__flags & DEF_GLOBAL) or (self.__flags & DEF_FREE_GLOBAL)) def is_vararg(self): diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index 9b95754..b119f62 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -60,7 +60,7 @@ if pid == pty.CHILD: os._exit(3) # After pty.fork(), the child should already be a session leader. - # (on those systems that have that concept.) + # (on those systems that have that concept.) debug("In child, calling os.setsid()") try: os.setsid() diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index 8da74f5..50b8b36 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -10,12 +10,12 @@ def zipTest(f, compression, srccontents): zip.write(srcname, "another.name") zip.write(srcname, srcname) zip.close() - + zip = zipfile.ZipFile(f, "r", compression) # Read the ZIP archive readData2 = zip.read(srcname) readData1 = zip.read("another.name") zip.close() - + if readData1 != srccontents or readData2 != srccontents: raise TestFailed, "Written data doesn't equal read data." @@ -25,11 +25,11 @@ try: for i in range(0, 1000): fp.write("Test of zipfile line %d.\n" % i) fp.close() - + fp = open(srcname, "rb") writtenData = fp.read() fp.close() - + for file in (zipname, tempfile.TemporaryFile(), StringIO.StringIO()): zipTest(file, zipfile.ZIP_STORED, writtenData) diff --git a/Lib/traceback.py b/Lib/traceback.py index 82906a3..a758349 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -221,7 +221,7 @@ def print_last(limit=None, file=None): def print_stack(f=None, limit=None, file=None): """Print a stack trace from its invocation point. - + The optional 'f' argument can be used to specify an alternate stack frame at which to start. The optional 'limit' and 'file' arguments have the same meaning as for print_exception(). diff --git a/Lib/unittest.py b/Lib/unittest.py index 850c38e..eac5e78 100644 --- a/Lib/unittest.py +++ b/Lib/unittest.py @@ -103,7 +103,7 @@ class TestResult: def stop(self): "Indicates that the tests should be aborted" self.shouldStop = 1 - + def __repr__(self): return "<%s run=%i errors=%i failures=%i>" % \ (self.__class__, self.testsRun, len(self.errors), @@ -116,12 +116,12 @@ class TestCase: By default, the test code itself should be placed in a method named 'runTest'. - If the fixture may be used for many test cases, create as + If the fixture may be used for many test cases, create as many test methods as are needed. When instantiating such a TestCase subclass, specify in the constructor arguments the name of the test method that the instance is to execute. - Test authors should subclass TestCase for their own tests. Construction + Test authors should subclass TestCase for their own tests. Construction and deconstruction of the test's environment ('fixture') can be implemented by overriding the 'setUp' and 'tearDown' methods respectively. @@ -480,7 +480,7 @@ class _WritelnDecorator: def writeln(self, *args): if args: apply(self.write, args) self.write('\n') # text-mode streams translate to \r\n if needed - + class _TextTestResult(TestResult): """A test result class that can print formatted text results to a stream. @@ -550,7 +550,7 @@ class _TextTestResult(TestResult): class TextTestRunner: """A test runner class that displays results in textual form. - + It prints out the names of tests as they are run, errors as they occur, and a summary of the results at the end of the test run. """ @@ -587,7 +587,7 @@ class TextTestRunner: else: self.stream.writeln("OK") return result - + ############################################################################## @@ -668,7 +668,7 @@ Examples: if self.testRunner is None: self.testRunner = TextTestRunner(verbosity=self.verbosity) result = self.testRunner.run(self.test) - sys.exit(not result.wasSuccessful()) + sys.exit(not result.wasSuccessful()) main = TestProgram diff --git a/Lib/zipfile.py b/Lib/zipfile.py index bf59043..b638592 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -131,10 +131,10 @@ class ZipInfo: class ZipFile: - """ Class with methods to open, read, write, close, list zip files. - + """ Class with methods to open, read, write, close, list zip files. + z = ZipFile(file, mode="r", compression=ZIP_STORED) - + file: Either the path to the file, or a file-like object. If it is a path, the file will be opened and closed by ZipFile. mode: The mode can be either read "r", write "w" or append "a". @@ -158,7 +158,7 @@ class ZipFile: self.filelist = [] # List of ZipInfo instances for archive self.compression = compression # Method of compression self.mode = key = mode[0] - + # Check if we were passed a file-like object if type(file) in _STRING_TYPES: self._filePassed = 0 @@ -169,7 +169,7 @@ class ZipFile: self._filePassed = 1 self.fp = file self.filename = getattr(file, 'name', None) - + if key == 'r': self._GetContents() elif key == 'w': |