diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-10-24 20:11:14 -0700 |
---|---|---|
committer | Paul McGuire <ptmcg@users.noreply.github.com> | 2019-10-24 22:11:14 -0500 |
commit | f73e2571fb643a2afdde365eeee0fe0f3f4f5300 (patch) | |
tree | f9015586cee7efc5e60eee78a8ebcbaa4e9e953d /examples/simpleWiki.py | |
parent | 696808023f10207461d7b22dc1d02cbed44e2bfa (diff) | |
download | pyparsing-git-f73e2571fb643a2afdde365eeee0fe0f3f4f5300.tar.gz |
Use pyupgrade to upgrade the code to use Python3 conventions (#138)
The pyupgrade project is available at
https://github.com/asottile/pyupgrade and can be installed through pip.
The pyupgrade tool automatically upgrades syntax for newer versions of
the language. As pyparsing is now Python 3 only, can apply some cleanups
and simplifications. Ran the tool using the following command:
$ find . -name \*.py -exec pyupgrade --py3-plus {} \;
For now, pyparsing.py was skipped while it is refactored to a package.
Diffstat (limited to 'examples/simpleWiki.py')
-rw-r--r-- | examples/simpleWiki.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/simpleWiki.py b/examples/simpleWiki.py index 35346bc..ca660c5 100644 --- a/examples/simpleWiki.py +++ b/examples/simpleWiki.py @@ -21,7 +21,7 @@ def convertToHTML_A(s,l,t): text,url=t[0].split("->")
except ValueError:
raise ParseFatalException(s,l,"invalid URL link reference: " + t[0])
- return '<A href="{0}">{1}</A>'.format(url, text)
+ return '<A href="{}">{}</A>'.format(url, text)
urlRef = QuotedString("{{",endQuoteChar="}}").setParseAction(convertToHTML_A)
|