Skip to content

Commit cdd7f28

Browse files
committed
Minor edit
1 parent 3dbdadc commit cdd7f28

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

switch_model/__main__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ def main():
3939
del sys.argv[1]
4040
if cmd == "--version":
4141
print("Switch model version " + switch_model.__version__)
42-
try:
43-
from switch_model.utilities import get_git_branch
42+
from switch_model.utilities import get_git_branch
4443

45-
print(f"Switch git branch {get_git_branch()}")
46-
except:
47-
pass
44+
branch = get_git_branch()
45+
if branch is not None:
46+
print(f"Switch Git branch: {branch}")
4847
return 0
4948
if cmd == "solve":
5049
from switch_model.solve import main

switch_model/utilities/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,6 @@ def run_command(command):
981981
)
982982

983983

984-
985984
@catch_exceptions("Failed to get Git Branch.")
986985
def get_git_branch():
987986
return run_command("git rev-parse --abbrev-ref HEAD")

0 commit comments

Comments
 (0)