Skip to content

Commit

Permalink
Use getattr to improve code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrjones committed Aug 12, 2022
1 parent 94852ea commit 5b817a4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions xbatcher/util/print_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ def _get_module_version(modname):
else:
module = importlib.import_module(modname)

try:
return module.__version__
except AttributeError:
return module.version
return getattr(module, '__version__', 'installed')
except ImportError:
return None

Expand Down

0 comments on commit 5b817a4

Please sign in to comment.