Skip to content

Commit

Permalink
Merge pull request #25 from lsst/tickets/DM-12656
Browse files Browse the repository at this point in the history
DM-12656: Stop using bare except
  • Loading branch information
timj committed Nov 17, 2017
2 parents 79b6bfd + bfa5b94 commit 7f6dd6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/lsst/base/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def getPythonPackages():
for module in PYTHON:
try:
importlib.import_module(module)
except:
except Exception:
pass # It's not available, so don't care

packages = {"python": sys.version}
Expand All @@ -103,7 +103,7 @@ def getPythonPackages():
module = sys.modules[name]
try:
ver = getVersionFromPythonModule(module)
except:
except Exception:
continue # Can't get a version from it, don't care

# Remove "foo.bar.version" in favor of "foo.bar"
Expand Down Expand Up @@ -140,7 +140,7 @@ def getEnvironmentPackages():
try:
from eups import Eups
from eups.Product import Product
except:
except ImportError:
from lsst.pex.logging import getDefaultLog
getDefaultLog().warn("Unable to import eups, so cannot determine package versions from environment")
return {}
Expand Down Expand Up @@ -173,7 +173,7 @@ def getEnvironmentPackages():
try:
rev = subprocess.check_output(revCmd).decode().strip()
diff = subprocess.check_output(diffCmd)
except:
except Exception:
ver += "@GIT_ERROR"
else:
ver += "@" + rev
Expand Down

0 comments on commit 7f6dd6b

Please sign in to comment.