--- a/setup.py Fri Apr 02 11:59:41 2021 +0200 +++ b/setup.py Sat May 01 14:27:20 2021 +0200 @@ -15,6 +15,7 @@ import fnmatch import datetime import json +import contextlib from setuptools import setup, find_packages @@ -135,10 +136,8 @@ if not fileName: return - try: + with contextlib.suppress(OSError): os.rename(fileName, fileName + ".orig") - except OSError: - pass try: hgOut = subprocess.check_output(["hg", "identify", "-i"]) # secok hgOut = hgOut.decode() @@ -170,10 +169,8 @@ if not fileName: return - try: + with contextlib.suppress(OSError): os.rename(fileName, fileName + ".orig") - except OSError: - pass with open(fileName + ".orig", "r", encoding="utf-8") as f: text = f.read() text = ( @@ -348,6 +345,11 @@ "Markdown", "pyyaml", "toml", + "chardet", + "asttokens", + "EditorConfig", + "Send2Trash", + "Pygments", "pywin32>=1.0;platform_system=='Windows'", ], data_files=getDataFiles(), @@ -398,8 +400,6 @@ # cleanup for fileName in [infoFileName, appdataFileName]: if os.path.exists(fileName + ".orig"): - try: + with contextlib.suppress(OSError): os.remove(fileName) os.rename(fileName + ".orig", fileName) - except OSError: - pass