]>
git.madduck.net Git - etc/vim.git/blobdiff - src/blib2to3/pgen2/conv.py
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
# Local imports
from pgen2 import grammar, token
# Local imports
from pgen2 import grammar, token
try:
f = open(filename)
except OSError as err:
try:
f = open(filename)
except OSError as err:
- print("Can't open %s: %s" % (filename, err) )
+ print(f"Can't open {filename}: {err}" )
return False
self.symbol2number = {}
self.number2symbol = {}
return False
self.symbol2number = {}
self.number2symbol = {}
lineno += 1
mo = re.match(r"^#define\s+(\w+)\s+(\d+)$", line)
if not mo and line.strip():
lineno += 1
mo = re.match(r"^#define\s+(\w+)\s+(\d+)$", line)
if not mo and line.strip():
- print("%s(%s): can't parse %s" % (filename, lineno, line.strip()) )
+ print(f"{filename}({lineno}): can't parse {line.strip()}" )
else:
symbol, number = mo.groups()
number = int(number)
else:
symbol, number = mo.groups()
number = int(number)
try:
f = open(filename)
except OSError as err:
try:
f = open(filename)
except OSError as err:
- print("Can't open %s: %s" % (filename, err) )
+ print(f"Can't open {filename}: {err}" )
return False
# The code below essentially uses f's iterator-ness!
lineno = 0
return False
# The code below essentially uses f's iterator-ness!
lineno = 0