Skip to content

Commit

Permalink
fix: stop version retrieval once one is found to avoid overwriting th…
Browse files Browse the repository at this point in the history
…e variable
  • Loading branch information
ogabrielluiz committed Nov 19, 2024
1 parent f1c0075 commit 05f7574
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backend/langflow/version/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def get_version() -> str:
_version = None
for pkg_name in pkg_names:
with contextlib.suppress(ImportError, metadata.PackageNotFoundError):
_version = metadata.version(pkg_name)
if _version := metadata.version(pkg_name):
break

if _version is None:
msg = f"Package not found from options {pkg_names}"
Expand Down

0 comments on commit 05f7574

Please sign in to comment.