##// END OF EJS Templates
avoid using abbreviations that look like spelling errors
Mads Kiilerich -
r17428:72803c8e default
parent child Browse files
Show More
@@ -136,7 +136,7 pypats = [
136 (r'\w[+/*\-<>]\w', "missing whitespace in expression"),
136 (r'\w[+/*\-<>]\w', "missing whitespace in expression"),
137 (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"),
137 (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"),
138 (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n'
138 (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n'
139 r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Py2.4'),
139 r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Python 2.4'),
140 (r'.{81}', "line too long"),
140 (r'.{81}', "line too long"),
141 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
141 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
142 (r'[^\n]\Z', "no trailing newline"),
142 (r'[^\n]\Z', "no trailing newline"),
@@ -190,8 +190,8 pypats = [
190 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
190 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
191 (r'opener\([^)]*\).read\(',
191 (r'opener\([^)]*\).read\(',
192 "use opener.read() instead"),
192 "use opener.read() instead"),
193 (r'BaseException', 'not in Py2.4, use Exception'),
193 (r'BaseException', 'not in Python 2.4, use Exception'),
194 (r'os\.path\.relpath', 'os.path.relpath is not in Py2.5'),
194 (r'os\.path\.relpath', 'os.path.relpath is not in Python 2.5'),
195 (r'opener\([^)]*\).write\(',
195 (r'opener\([^)]*\).write\(',
196 "use opener.write() instead"),
196 "use opener.write() instead"),
197 (r'[\s\(](open|file)\([^)]*\)\.read\(',
197 (r'[\s\(](open|file)\([^)]*\)\.read\(',
@@ -119,7 +119,7 def wrapname(name, wrapper):
119 def f(*args, **kwds):
119 def f(*args, **kwds):
120 return wrapper(func, args, kwds)
120 return wrapper(func, args, kwds)
121 try:
121 try:
122 f.__name__ = func.__name__ # fail with python23
122 f.__name__ = func.__name__ # fails with Python 2.3
123 except Exception:
123 except Exception:
124 pass
124 pass
125 setattr(module, name, f)
125 setattr(module, name, f)
@@ -1272,8 +1272,7 class Zeroconf(object):
1272 self.socket.bind(self.group)
1272 self.socket.bind(self.group)
1273 except Exception:
1273 except Exception:
1274 # Some versions of linux raise an exception even though
1274 # Some versions of linux raise an exception even though
1275 # the SO_REUSE* options have been set, so ignore it
1275 # SO_REUSEADDR and SO_REUSEPORT have been set, so ignore it
1276 #
1277 pass
1276 pass
1278 self.socket.setsockopt(socket.SOL_IP, socket.IP_ADD_MEMBERSHIP, socket.inet_aton(_MDNS_ADDR) + socket.inet_aton('0.0.0.0'))
1277 self.socket.setsockopt(socket.SOL_IP, socket.IP_ADD_MEMBERSHIP, socket.inet_aton(_MDNS_ADDR) + socket.inet_aton('0.0.0.0'))
1279
1278
@@ -154,7 +154,7 def hook(ui, repo, name, throw=False, **
154 oldstdout = os.dup(stdoutno)
154 oldstdout = os.dup(stdoutno)
155 os.dup2(stderrno, stdoutno)
155 os.dup2(stderrno, stdoutno)
156 except AttributeError:
156 except AttributeError:
157 # __stdout/err__ doesn't have fileno(), it's not a real file
157 # __stdout__/__stderr__ doesn't have fileno(), it's not a real file
158 pass
158 pass
159
159
160 try:
160 try:
@@ -170,7 +170,7 class HTTPResponse(object):
170 except socket.sslerror, e:
170 except socket.sslerror, e:
171 if e.args[0] != socket.SSL_ERROR_WANT_READ:
171 if e.args[0] != socket.SSL_ERROR_WANT_READ:
172 raise
172 raise
173 logger.debug('SSL_WANT_READ in _select, should retry later')
173 logger.debug('SSL_ERROR_WANT_READ in _select, should retry later')
174 return True
174 return True
175 logger.debug('response read %d data during _select', len(data))
175 logger.debug('response read %d data during _select', len(data))
176 # If the socket was readable and no data was read, that means
176 # If the socket was readable and no data was read, that means
@@ -532,7 +532,7 class HTTPConnection(object):
532 if e.args[0] != socket.SSL_ERROR_WANT_READ:
532 if e.args[0] != socket.SSL_ERROR_WANT_READ:
533 raise
533 raise
534 logger.debug(
534 logger.debug(
535 'SSL_WANT_READ while sending data, retrying...')
535 'SSL_ERROR_WANT_READ while sending data, retrying...')
536 continue
536 continue
537 if not data:
537 if not data:
538 logger.info('socket appears closed in read')
538 logger.info('socket appears closed in read')
@@ -73,7 +73,7 def readauthforuri(ui, uri, user):
73 if '://' in uri:
73 if '://' in uri:
74 scheme, hostpath = uri.split('://', 1)
74 scheme, hostpath = uri.split('://', 1)
75 else:
75 else:
76 # py2.4.1 doesn't provide the full URI
76 # Python 2.4.1 doesn't provide the full URI
77 scheme, hostpath = 'http', uri
77 scheme, hostpath = 'http', uri
78 bestuser = None
78 bestuser = None
79 bestlen = 0
79 bestlen = 0
@@ -154,7 +154,7 class manifest(revlog.revlog):
154 # combine the changed lists into one list for sorting
154 # combine the changed lists into one list for sorting
155 work = [(x, False) for x in added]
155 work = [(x, False) for x in added]
156 work.extend((x, True) for x in removed)
156 work.extend((x, True) for x in removed)
157 # this could use heapq.merge() (from python2.6+) or equivalent
157 # this could use heapq.merge() (from Python 2.6+) or equivalent
158 # since the lists are already sorted
158 # since the lists are already sorted
159 work.sort()
159 work.sort()
160
160
@@ -278,7 +278,8 def _generic_proxytunnel(self):
278 res.will_close = res._check_close()
278 res.will_close = res._check_close()
279
279
280 # do we have a Content-Length?
280 # do we have a Content-Length?
281 # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked"
281 # NOTE: RFC 2616, section 4.4, #3 says we ignore this if
282 # transfer-encoding is "chunked"
282 length = res.msg.getheader('content-length')
283 length = res.msg.getheader('content-length')
283 if length and not res.chunked:
284 if length and not res.chunked:
284 try:
285 try:
@@ -328,7 +328,7 def spawndetached(args):
328 env += '\0'
328 env += '\0'
329
329
330 args = subprocess.list2cmdline(args)
330 args = subprocess.list2cmdline(args)
331 # Not running the command in shell mode makes python26 hang when
331 # Not running the command in shell mode makes Python 2.6 hang when
332 # writing to hgweb output socket.
332 # writing to hgweb output socket.
333 comspec = os.environ.get("COMSPEC", "cmd.exe")
333 comspec = os.environ.get("COMSPEC", "cmd.exe")
334 args = comspec + " /c " + args
334 args = comspec + " /c " + args
@@ -83,7 +83,7
83 any/all/format not available in Python 2.4
83 any/all/format not available in Python 2.4
84 ./non-py24.py:11:
84 ./non-py24.py:11:
85 > try:
85 > try:
86 no try/except/finally in Py2.4
86 no try/except/finally in Python 2.4
87 ./classstyle.py:4:
87 ./classstyle.py:4:
88 > class oldstyle_class:
88 > class oldstyle_class:
89 old-style class, use class foo(object)
89 old-style class, use class foo(object)
General Comments 0
You need to be logged in to leave comments. Login now