diff options
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/UserString.py | 4 | ||||
-rw-r--r-- | Lib/distutils/command/upload.py | 9 | ||||
-rw-r--r-- | Lib/distutils/tests/test_dist.py | 2 | ||||
-rw-r--r-- | Lib/distutils/tests/test_versionpredicate.py | 2 | ||||
-rw-r--r-- | Lib/distutils/versionpredicate.py | 6 | ||||
-rw-r--r-- | Lib/gzip.py | 4 | ||||
-rw-r--r-- | Lib/subprocess.py | 8 | ||||
-rw-r--r-- | Lib/tarfile.py | 2 | ||||
-rwxr-xr-x | Lib/test/regrtest.py | 2 | ||||
-rw-r--r-- | Lib/test/test_functional.py | 2 | ||||
-rw-r--r-- | Lib/test/test_mmap.py | 12 | ||||
-rw-r--r-- | Lib/test/test_subprocess.py | 2 | ||||
-rw-r--r-- | Lib/test/test_xdrlib.py | 1 |
13 files changed, 27 insertions, 29 deletions
diff --git a/Lib/UserString.py b/Lib/UserString.py index 3251139..94eb66d 100755 --- a/Lib/UserString.py +++ b/Lib/UserString.py @@ -147,12 +147,12 @@ class MutableString(UserString): raise TypeError, "unhashable type (it is mutable)" def __setitem__(self, index, sub): if index < 0: - index += len(self.data) + index += len(self.data) if index < 0 or index >= len(self.data): raise IndexError self.data = self.data[:index] + sub + self.data[index+1:] def __delitem__(self, index): if index < 0: - index += len(self.data) + index += len(self.data) if index < 0 or index >= len(self.data): raise IndexError self.data = self.data[:index] + self.data[index+1:] def __setslice__(self, start, end, sub): diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py index d1d5ec6..7b08336 100644 --- a/Lib/distutils/command/upload.py +++ b/Lib/distutils/command/upload.py @@ -133,7 +133,7 @@ class upload(Command): schema, netloc, url, params, query, fragments = \ urlparse.urlparse(self.repository) assert not params and not query and not fragments - if schema == 'http': + if schema == 'http': http = httplib.HTTPConnection(netloc) elif schema == 'https': http = httplib.HTTPSConnection(netloc) @@ -145,7 +145,7 @@ class upload(Command): try: http.connect() http.putrequest("POST", url) - http.putheader('Content-type', + http.putheader('Content-type', 'multipart/form-data; boundary=%s'%boundary) http.putheader('Content-length', str(len(body))) http.putheader('Authorization', auth) @@ -157,11 +157,10 @@ class upload(Command): r = http.getresponse() if r.status == 200: - self.announce('Server response (%s): %s' % (r.status, r.reason), + self.announce('Server response (%s): %s' % (r.status, r.reason), log.INFO) else: - self.announce('Upload failed (%s): %s' % (r.status, r.reason), + self.announce('Upload failed (%s): %s' % (r.status, r.reason), log.ERROR) if self.show_response: print '-'*75, r.read(), '-'*75 - diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py index 7675fbf..4d2a7cd 100644 --- a/Lib/distutils/tests/test_dist.py +++ b/Lib/distutils/tests/test_dist.py @@ -175,7 +175,7 @@ class MetadataTestCase(unittest.TestCase): {"name": "package", "version": "1.0", "obsoletes": ["my.pkg (splat)"]}) - + def format_metadata(self, dist): sio = StringIO.StringIO() dist.metadata.write_pkg_file(sio) diff --git a/Lib/distutils/tests/test_versionpredicate.py b/Lib/distutils/tests/test_versionpredicate.py index 44cb41e..8a60dbe 100644 --- a/Lib/distutils/tests/test_versionpredicate.py +++ b/Lib/distutils/tests/test_versionpredicate.py @@ -6,4 +6,4 @@ import distutils.versionpredicate import doctest def test_suite(): - return doctest.DocTestSuite(distutils.versionpredicate) + return doctest.DocTestSuite(distutils.versionpredicate) diff --git a/Lib/distutils/versionpredicate.py b/Lib/distutils/versionpredicate.py index 62d89f8..ba8b6c0 100644 --- a/Lib/distutils/versionpredicate.py +++ b/Lib/distutils/versionpredicate.py @@ -101,10 +101,10 @@ class VersionPredicate: versionPredicateStr = versionPredicateStr.strip() if not versionPredicateStr: - raise ValueError("empty package restriction") + raise ValueError("empty package restriction") match = re_validPackage.match(versionPredicateStr) if not match: - raise ValueError("bad package name in %r" % versionPredicateStr) + raise ValueError("bad package name in %r" % versionPredicateStr) self.name, paren = match.groups() paren = paren.strip() if paren: @@ -114,7 +114,7 @@ class VersionPredicate: str = match.groups()[0] self.pred = [splitUp(aPred) for aPred in str.split(",")] if not self.pred: - raise ValueError("empty parenthesized list in %r" + raise ValueError("empty parenthesized list in %r" % versionPredicateStr) else: self.pred = [] diff --git a/Lib/gzip.py b/Lib/gzip.py index 48bd522..4ecd211 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -333,8 +333,8 @@ class GzipFile: def flush(self,zlib_mode=zlib.Z_SYNC_FLUSH): if self.mode == WRITE: - # Ensure the compressor's buffer is flushed - self.fileobj.write(self.compress.flush(zlib_mode)) + # Ensure the compressor's buffer is flushed + self.fileobj.write(self.compress.flush(zlib_mode)) self.fileobj.flush() def fileno(self): diff --git a/Lib/subprocess.py b/Lib/subprocess.py index e72e260..783f617 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -626,14 +626,14 @@ class Popen(object): process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be sent to the child. - + communicate() returns a tuple (stdout, stderr).""" # Optimization: If we are only using one pipe, or no pipe at # all, using select() or threads is unnecessary. if [self.stdin, self.stdout, self.stderr].count(None) >= 2: - stdout = None - stderr = None + stdout = None + stderr = None if self.stdin: if input: self.stdin.write(input) @@ -644,7 +644,7 @@ class Popen(object): stderr = self.stderr.read() self.wait() return (stdout, stderr) - + return self._communicate(input) diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 56cce03..867b242 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -665,7 +665,7 @@ class ExFileObject(object): if not result: raise StopIteration return result - + #class ExFileObject #------------------ diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 20407f8..6160b3d 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -93,7 +93,7 @@ resources to test. Currently only the following are defined: in the standard library and test suite. This takes a long time. - subprocess Run all tests for the subprocess module. + subprocess Run all tests for the subprocess module. To enable all resources except one, use '-uall,-<resource>'. For example, to run all the tests except for the bsddb tests, give the diff --git a/Lib/test/test_functional.py b/Lib/test/test_functional.py index 97e30c3..5078a2e 100644 --- a/Lib/test/test_functional.py +++ b/Lib/test/test_functional.py @@ -139,7 +139,7 @@ class TestPartial(unittest.TestCase): self.assertEqual(join(data), '0123456789') join = self.thetype(''.join) self.assertEqual(join(data), '0123456789') - + class PartialSubclass(functional.partial): pass diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index d225173..efb7180 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -321,7 +321,7 @@ def test_both(): f.close() f = open(TESTFN, "rb+") - mf = mmap.mmap(f.fileno(), 0) + mf = mmap.mmap(f.fileno(), 0) verify(len(mf) == 2**16, "Map size should equal file size.") vereq(mf.read(2**16), 2**16 * "m") mf.close() @@ -329,7 +329,7 @@ def test_both(): finally: os.unlink(TESTFN) - + # test mapping of entire file by passing 0 for map length if hasattr(os, "stat"): print " Ensuring that passing 0 as map length sets map size to current file size." @@ -337,17 +337,17 @@ def test_both(): try: f.write(2**16 * 'm') # Arbitrary character f.close() - + f = open(TESTFN, "rb+") - mf = mmap.mmap(f.fileno(), 0) + mf = mmap.mmap(f.fileno(), 0) verify(len(mf) == 2**16, "Map size should equal file size.") vereq(mf.read(2**16), 2**16 * "m") mf.close() f.close() - + finally: os.unlink(TESTFN) - + print ' Test passed' test_both() diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index e6f981d..c351ee9 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -387,7 +387,7 @@ class ProcessTestCase(unittest.TestCase): if test_support.is_resource_enabled("subprocess") and not mswindows: max_handles = 1026 # too much for most UNIX systems else: - max_handles = 65 + max_handles = 65 for i in range(max_handles): p = subprocess.Popen([sys.executable, "-c", "import sys;sys.stdout.write(sys.stdin.read())"], diff --git a/Lib/test/test_xdrlib.py b/Lib/test/test_xdrlib.py index afa6afe..e9517c5 100644 --- a/Lib/test/test_xdrlib.py +++ b/Lib/test/test_xdrlib.py @@ -1,4 +1,3 @@ import xdrlib xdrlib._test() - |