Use except Exception where Py2/3 disagrees

This commit is contained in:
Kagami Sascha Rosylight 2020-06-21 04:30:23 +02:00
parent d01648d637
commit 57eed5baa4
4 changed files with 6 additions and 6 deletions

View file

@ -475,7 +475,7 @@ class MachCommands(CommandBase):
if os.path.exists(crate_path):
try:
delete(crate_path)
except (FileNotFoundError, PermissionError):
except Exception:
print(traceback.format_exc())
print("Delete %s failed!" % crate_path)
else:

View file

@ -920,7 +920,7 @@ def package_gstreamer_dlls(env, servo_exe_dir, target, uwp):
for gst_lib in gst_dlls:
try:
shutil.copy(path.join(gst_root, "bin", gst_lib), servo_exe_dir)
except FileNotFoundError:
except Exception:
missing += [str(gst_lib)]
for gst_lib in missing:
@ -976,7 +976,7 @@ def package_gstreamer_dlls(env, servo_exe_dir, target, uwp):
for gst_lib in gst_dlls:
try:
shutil.copy(path.join(gst_plugin_path, gst_lib), servo_exe_dir)
except FileNotFoundError:
except Exception:
missing += [str(gst_lib)]
for gst_lib in missing:

View file

@ -537,7 +537,7 @@ class CommandBase(object):
try:
if check_gstreamer_lib():
return False
except (FileNotFoundError, WindowsError):
except Exception:
# Some systems don't have pkg-config; we can't probe in this case
# and must hope for the best
return False

View file

@ -26,13 +26,13 @@ here = os.path.dirname(os.path.abspath(__file__))
try:
with open(os.path.join(here, 'README.rst')) as doc:
readme = doc.read()
except FileNotFoundError:
except Exception:
readme = ''
try:
with open(os.path.join(here, 'HISTORY.rst')) as doc:
history = doc.read()
except FileNotFoundError:
except Exception:
history = ''
long_description = readme + '\n\n' + history