[tor-commits] [bridgedb/develop] Fix output of bridgedb --version.
isis at torproject.org
isis at torproject.org
Wed Nov 15 22:24:50 UTC 2017
commit 914d0b9a158e3c210d17b84e3648a5962daa97ed
Author: Isis Lovecruft <isis at torproject.org>
Date: Wed Nov 1 20:56:23 2017 +0000
Fix output of bridgedb --version.
---
bridgedb/parse/options.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/bridgedb/parse/options.py b/bridgedb/parse/options.py
index 6f3bfc1..d866ac8 100644
--- a/bridgedb/parse/options.py
+++ b/bridgedb/parse/options.py
@@ -168,7 +168,13 @@ class BaseOptions(usage.Options):
def opt_version(self):
"""Display BridgeDB's version and exit."""
- print("%s-%s" % (__package__, __version__))
+ if "." in __package__:
+ pkg = __package__.split(".", 1)[0] # Just the parent package
+ else:
+ pkg = __package__
+
+ print("%s-%s" % (pkg, __version__))
+
sys.exit(0)
@staticmethod
More information about the tor-commits
mailing list