Skip to content

Commit 8b2fbaf

Browse files
jroelofsThomas Preud'homme
authored andcommitted
Make the version check PEP440-compliant
rdar://91296762 Reviewed By: cmatthews Differential Revision: https://reviews.llvm.org/D123227
1 parent cbee513 commit 8b2fbaf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lnt/lnttool/main.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -471,15 +471,15 @@ def _version_check():
471471

472472
# Get the current distribution.
473473
installed_dist = pkg_resources.get_distribution("LNT")
474-
installed_dist_name = "%s %s" % (installed_dist.project_name,
475-
installed_dist.version)
476-
current_dist_name = "LNT %s" % (lnt.__version__,)
477-
if pkg_resources.parse_version(installed_dist_name) != \
478-
pkg_resources.parse_version(current_dist_name):
474+
if installed_dist.project_name != "LNT" or \
475+
pkg_resources.parse_version(installed_dist.version) != \
476+
pkg_resources.parse_version(lnt.__version__):
479477
raise SystemExit("""\
480-
error: installed distribution %s is not current (%s), you may need to reinstall
478+
error: installed distribution %s %s is not current (%s %s), you may need to reinstall
481479
LNT or rerun 'setup.py develop' if using development mode.""" % (
482-
installed_dist_name, current_dist_name))
480+
installed_dist.project_name,
481+
installed_dist.version,
482+
"LNT", lnt.__version__))
483483

484484

485485
def show_version(ctx, param, value):

0 commit comments

Comments
 (0)