Mercurial > hg
comparison hgext/convert/gnuarch.py @ 25658:e93036747902
global: mass rewrite to use modern octal syntax
Python 2.6 introduced a new octal syntax: "0oXXX", replacing "0XXX". The
old syntax is not recognized in Python 3 and will result in a parse
error.
Mass rewrite all instances of the old octal syntax to the new syntax.
This patch was generated by `2to3 -f numliterals -w -n .` and the diff
was selectively recorded to exclude changes to "<N>l" syntax conversion,
which will be handled separately.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 23 Jun 2015 22:30:33 -0700 |
parents | 216fa1ba9993 |
children | baea47cafe75 |
comparison
equal
deleted
inserted
replaced
25657:dcc56e10c23b | 25658:e93036747902 |
---|---|
213 mode = 'l' | 213 mode = 'l' |
214 else: | 214 else: |
215 mode = '' | 215 mode = '' |
216 else: | 216 else: |
217 data = open(os.path.join(self.tmppath, name), 'rb').read() | 217 data = open(os.path.join(self.tmppath, name), 'rb').read() |
218 mode = (mode & 0111) and 'x' or '' | 218 mode = (mode & 0o111) and 'x' or '' |
219 return data, mode | 219 return data, mode |
220 | 220 |
221 def _exclude(self, name): | 221 def _exclude(self, name): |
222 exclude = ['{arch}', '.arch-ids', '.arch-inventory'] | 222 exclude = ['{arch}', '.arch-ids', '.arch-inventory'] |
223 for exc in exclude: | 223 for exc in exclude: |