diff options
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/check_sources.py | 5 | ||||
-rwxr-xr-x | utils/reindent.py | 9 | ||||
-rw-r--r-- | utils/release-checklist | 1 |
3 files changed, 6 insertions, 9 deletions
diff --git a/utils/check_sources.py b/utils/check_sources.py index 16bc918cb..18d444057 100755 --- a/utils/check_sources.py +++ b/utils/check_sources.py @@ -223,11 +223,8 @@ def main(argv): print("Checking %s..." % fn) try: - f = open(fn, 'rb') - try: + with open(fn, 'rb') as f: lines = list(f) - finally: - f.close() except (IOError, OSError) as err: print("%s: cannot open: %s" % (fn, err)) num += 1 diff --git a/utils/reindent.py b/utils/reindent.py index 9af46d3fc..a4fe93e24 100755 --- a/utils/reindent.py +++ b/utils/reindent.py @@ -127,8 +127,8 @@ def check(file): errprint("%s: I/O Error: %s" % (file, str(msg))) return - r = Reindenter(f) - f.close() + with f: + r = Reindenter(f) if r.run(): if verbose: print("changed.") @@ -140,9 +140,8 @@ def check(file): shutil.copyfile(file, bak) if verbose: print("backed up", file, "to", bak) - f = open(file, "w") - r.write(f) - f.close() + with open(file, "w") as f: + r.write(f) if verbose: print("wrote new", file) return True diff --git a/utils/release-checklist b/utils/release-checklist index 3dd52158c..b73a191f9 100644 --- a/utils/release-checklist +++ b/utils/release-checklist @@ -9,6 +9,7 @@ Release checklist * Update release date in CHANGES * `git commit -am 'Bump to x.y.z final'` * `make clean` +* `python setup.py compile_grammar` * `python setup.py release bdist_wheel sdist upload --identity=[your key]` * Check PyPI release page for obvious errors * `git tag` with version number |