Show More
@@ -136,7 +136,7 b' pypats = [' | |||
|
136 | 136 | (r'\w[+/*\-<>]\w', "missing whitespace in expression"), |
|
137 | 137 | (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"), |
|
138 | 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 | 140 | (r'.{81}', "line too long"), |
|
141 | 141 | (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'), |
|
142 | 142 | (r'[^\n]\Z', "no trailing newline"), |
@@ -190,8 +190,8 b' pypats = [' | |||
|
190 | 190 | 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'), |
|
191 | 191 | (r'opener\([^)]*\).read\(', |
|
192 | 192 | "use opener.read() instead"), |
|
193 | (r'BaseException', 'not in Py2.4, use Exception'), | |
|
194 | (r'os\.path\.relpath', 'os.path.relpath is not in Py2.5'), | |
|
193 | (r'BaseException', 'not in Python 2.4, use Exception'), | |
|
194 | (r'os\.path\.relpath', 'os.path.relpath is not in Python 2.5'), | |
|
195 | 195 | (r'opener\([^)]*\).write\(', |
|
196 | 196 | "use opener.write() instead"), |
|
197 | 197 | (r'[\s\(](open|file)\([^)]*\)\.read\(', |
@@ -119,7 +119,7 b' def wrapname(name, wrapper):' | |||
|
119 | 119 | def f(*args, **kwds): |
|
120 | 120 | return wrapper(func, args, kwds) |
|
121 | 121 | try: |
|
122 |
f.__name__ = func.__name__ |
|
|
122 | f.__name__ = func.__name__ # fails with Python 2.3 | |
|
123 | 123 | except Exception: |
|
124 | 124 | pass |
|
125 | 125 | setattr(module, name, f) |
@@ -1272,8 +1272,7 b' class Zeroconf(object):' | |||
|
1272 | 1272 | self.socket.bind(self.group) |
|
1273 | 1273 | except Exception: |
|
1274 | 1274 | # Some versions of linux raise an exception even though |
|
1275 |
# |
|
|
1276 | # | |
|
1275 | # SO_REUSEADDR and SO_REUSEPORT have been set, so ignore it | |
|
1277 | 1276 | pass |
|
1278 | 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 b' def hook(ui, repo, name, throw=False, **' | |||
|
154 | 154 | oldstdout = os.dup(stdoutno) |
|
155 | 155 | os.dup2(stderrno, stdoutno) |
|
156 | 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 | 158 | pass |
|
159 | 159 | |
|
160 | 160 | try: |
@@ -170,7 +170,7 b' class HTTPResponse(object):' | |||
|
170 | 170 | except socket.sslerror, e: |
|
171 | 171 | if e.args[0] != socket.SSL_ERROR_WANT_READ: |
|
172 | 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 | 174 | return True |
|
175 | 175 | logger.debug('response read %d data during _select', len(data)) |
|
176 | 176 | # If the socket was readable and no data was read, that means |
@@ -532,7 +532,7 b' class HTTPConnection(object):' | |||
|
532 | 532 | if e.args[0] != socket.SSL_ERROR_WANT_READ: |
|
533 | 533 | raise |
|
534 | 534 | logger.debug( |
|
535 | 'SSL_WANT_READ while sending data, retrying...') | |
|
535 | 'SSL_ERROR_WANT_READ while sending data, retrying...') | |
|
536 | 536 | continue |
|
537 | 537 | if not data: |
|
538 | 538 | logger.info('socket appears closed in read') |
@@ -73,7 +73,7 b' def readauthforuri(ui, uri, user):' | |||
|
73 | 73 | if '://' in uri: |
|
74 | 74 | scheme, hostpath = uri.split('://', 1) |
|
75 | 75 | else: |
|
76 |
# |
|
|
76 | # Python 2.4.1 doesn't provide the full URI | |
|
77 | 77 | scheme, hostpath = 'http', uri |
|
78 | 78 | bestuser = None |
|
79 | 79 | bestlen = 0 |
@@ -13,7 +13,7 b' import email.Header, email.MIMEText, ema' | |||
|
13 | 13 | _oldheaderinit = email.Header.Header.__init__ |
|
14 | 14 | def _unifiedheaderinit(self, *args, **kw): |
|
15 | 15 | """ |
|
16 | Python2.7 introduces a backwards incompatible change | |
|
16 | Python 2.7 introduces a backwards incompatible change | |
|
17 | 17 | (Python issue1974, r70772) in email.Generator.Generator code: |
|
18 | 18 | pre-2.7 code passed "continuation_ws='\t'" to the Header |
|
19 | 19 | constructor, and 2.7 removed this parameter. |
@@ -154,7 +154,7 b' class manifest(revlog.revlog):' | |||
|
154 | 154 | # combine the changed lists into one list for sorting |
|
155 | 155 | work = [(x, False) for x in added] |
|
156 | 156 | work.extend((x, True) for x in removed) |
|
157 |
# this could use heapq.merge() (from |
|
|
157 | # this could use heapq.merge() (from Python 2.6+) or equivalent | |
|
158 | 158 | # since the lists are already sorted |
|
159 | 159 | work.sort() |
|
160 | 160 |
@@ -278,7 +278,8 b' def _generic_proxytunnel(self):' | |||
|
278 | 278 | res.will_close = res._check_close() |
|
279 | 279 | |
|
280 | 280 | # do we have a Content-Length? |
|
281 |
# NOTE: RFC 2616, |
|
|
281 | # NOTE: RFC 2616, section 4.4, #3 says we ignore this if | |
|
282 | # transfer-encoding is "chunked" | |
|
282 | 283 | length = res.msg.getheader('content-length') |
|
283 | 284 | if length and not res.chunked: |
|
284 | 285 | try: |
@@ -328,7 +328,7 b' def spawndetached(args):' | |||
|
328 | 328 | env += '\0' |
|
329 | 329 | |
|
330 | 330 | args = subprocess.list2cmdline(args) |
|
331 |
# Not running the command in shell mode makes |
|
|
331 | # Not running the command in shell mode makes Python 2.6 hang when | |
|
332 | 332 | # writing to hgweb output socket. |
|
333 | 333 | comspec = os.environ.get("COMSPEC", "cmd.exe") |
|
334 | 334 | args = comspec + " /c " + args |
General Comments 0
You need to be logged in to leave comments.
Login now