commit 914d0b9a158e3c210d17b84e3648a5962daa97ed Author: Isis Lovecruft isis@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
tor-commits@lists.torproject.org