diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -136,7 +136,7 @@ pypats = [ (r'\w[+/*\-<>]\w', "missing whitespace in expression"), (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"), (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n' - r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Py2.4'), + r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Python 2.4'), (r'.{81}', "line too long"), (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'), (r'[^\n]\Z', "no trailing newline"), @@ -190,8 +190,8 @@ pypats = [ 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'), (r'opener\([^)]*\).read\(', "use opener.read() instead"), - (r'BaseException', 'not in Py2.4, use Exception'), - (r'os\.path\.relpath', 'os.path.relpath is not in Py2.5'), + (r'BaseException', 'not in Python 2.4, use Exception'), + (r'os\.path\.relpath', 'os.path.relpath is not in Python 2.5'), (r'opener\([^)]*\).write\(', "use opener.write() instead"), (r'[\s\(](open|file)\([^)]*\)\.read\(', diff --git a/hgext/win32mbcs.py b/hgext/win32mbcs.py --- a/hgext/win32mbcs.py +++ b/hgext/win32mbcs.py @@ -119,7 +119,7 @@ def wrapname(name, wrapper): def f(*args, **kwds): return wrapper(func, args, kwds) try: - f.__name__ = func.__name__ # fail with python23 + f.__name__ = func.__name__ # fails with Python 2.3 except Exception: pass setattr(module, name, f) diff --git a/hgext/zeroconf/Zeroconf.py b/hgext/zeroconf/Zeroconf.py --- a/hgext/zeroconf/Zeroconf.py +++ b/hgext/zeroconf/Zeroconf.py @@ -1272,8 +1272,7 @@ class Zeroconf(object): self.socket.bind(self.group) except Exception: # Some versions of linux raise an exception even though - # the SO_REUSE* options have been set, so ignore it - # + # SO_REUSEADDR and SO_REUSEPORT have been set, so ignore it pass self.socket.setsockopt(socket.SOL_IP, socket.IP_ADD_MEMBERSHIP, socket.inet_aton(_MDNS_ADDR) + socket.inet_aton('0.0.0.0')) diff --git a/mercurial/hook.py b/mercurial/hook.py --- a/mercurial/hook.py +++ b/mercurial/hook.py @@ -154,7 +154,7 @@ def hook(ui, repo, name, throw=False, ** oldstdout = os.dup(stdoutno) os.dup2(stderrno, stdoutno) except AttributeError: - # __stdout/err__ doesn't have fileno(), it's not a real file + # __stdout__/__stderr__ doesn't have fileno(), it's not a real file pass try: diff --git a/mercurial/httpclient/__init__.py b/mercurial/httpclient/__init__.py --- a/mercurial/httpclient/__init__.py +++ b/mercurial/httpclient/__init__.py @@ -170,7 +170,7 @@ class HTTPResponse(object): except socket.sslerror, e: if e.args[0] != socket.SSL_ERROR_WANT_READ: raise - logger.debug('SSL_WANT_READ in _select, should retry later') + logger.debug('SSL_ERROR_WANT_READ in _select, should retry later') return True logger.debug('response read %d data during _select', len(data)) # If the socket was readable and no data was read, that means @@ -532,7 +532,7 @@ class HTTPConnection(object): if e.args[0] != socket.SSL_ERROR_WANT_READ: raise logger.debug( - 'SSL_WANT_READ while sending data, retrying...') + 'SSL_ERROR_WANT_READ while sending data, retrying...') continue if not data: logger.info('socket appears closed in read') diff --git a/mercurial/httpconnection.py b/mercurial/httpconnection.py --- a/mercurial/httpconnection.py +++ b/mercurial/httpconnection.py @@ -73,7 +73,7 @@ def readauthforuri(ui, uri, user): if '://' in uri: scheme, hostpath = uri.split('://', 1) else: - # py2.4.1 doesn't provide the full URI + # Python 2.4.1 doesn't provide the full URI scheme, hostpath = 'http', uri bestuser = None bestlen = 0 diff --git a/mercurial/mail.py b/mercurial/mail.py --- a/mercurial/mail.py +++ b/mercurial/mail.py @@ -13,7 +13,7 @@ import email.Header, email.MIMEText, ema _oldheaderinit = email.Header.Header.__init__ def _unifiedheaderinit(self, *args, **kw): """ - Python2.7 introduces a backwards incompatible change + Python 2.7 introduces a backwards incompatible change (Python issue1974, r70772) in email.Generator.Generator code: pre-2.7 code passed "continuation_ws='\t'" to the Header constructor, and 2.7 removed this parameter. diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -154,7 +154,7 @@ class manifest(revlog.revlog): # combine the changed lists into one list for sorting work = [(x, False) for x in added] work.extend((x, True) for x in removed) - # this could use heapq.merge() (from python2.6+) or equivalent + # this could use heapq.merge() (from Python 2.6+) or equivalent # since the lists are already sorted work.sort() diff --git a/mercurial/url.py b/mercurial/url.py --- a/mercurial/url.py +++ b/mercurial/url.py @@ -278,7 +278,8 @@ def _generic_proxytunnel(self): res.will_close = res._check_close() # do we have a Content-Length? - # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked" + # NOTE: RFC 2616, section 4.4, #3 says we ignore this if + # transfer-encoding is "chunked" length = res.msg.getheader('content-length') if length and not res.chunked: try: diff --git a/mercurial/win32.py b/mercurial/win32.py --- a/mercurial/win32.py +++ b/mercurial/win32.py @@ -328,7 +328,7 @@ def spawndetached(args): env += '\0' args = subprocess.list2cmdline(args) - # Not running the command in shell mode makes python26 hang when + # Not running the command in shell mode makes Python 2.6 hang when # writing to hgweb output socket. comspec = os.environ.get("COMSPEC", "cmd.exe") args = comspec + " /c " + args diff --git a/tests/test-check-code.t b/tests/test-check-code.t --- a/tests/test-check-code.t +++ b/tests/test-check-code.t @@ -83,7 +83,7 @@ any/all/format not available in Python 2.4 ./non-py24.py:11: > try: - no try/except/finally in Py2.4 + no try/except/finally in Python 2.4 ./classstyle.py:4: > class oldstyle_class: old-style class, use class foo(object)