diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-01-22 16:21:17 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-01-22 16:21:17 +0100 |
commit | 5811e79361f855d370466c695bd4facf41cbe872 (patch) | |
tree | 98009ece9d69248d7a5403330740a748823c45da | |
parent | 9044b8b8f534debf84de553bf1e57cd91a08ee91 (diff) | |
download | mitmproxy-5811e79361f855d370466c695bd4facf41cbe872.tar.gz mitmproxy-5811e79361f855d370466c695bd4facf41cbe872.tar.bz2 mitmproxy-5811e79361f855d370466c695bd4facf41cbe872.zip |
print warning if netlib and mitmproxy versions are different.
-rwxr-xr-x | mitmdump | 10 | ||||
-rwxr-xr-x | mitmproxy | 10 |
2 files changed, 16 insertions, 4 deletions
@@ -1,11 +1,17 @@ #!/usr/bin/env python import sys, signal -from libmproxy import proxy, dump, cmdline, version +from libmproxy import proxy, dump, cmdline +import libmproxy.version, netlib.version import argparse if __name__ == '__main__': + # We don't introduce backward-incompatible changes in patch versions. Only consider major and minor version. + if netlib.version.IVERSION[:2] != libmproxy.version.IVERSION[:2]: + print >> sys.stderr, ("warning: You are using mitmdump %s with netlib %s. " + "Most likely, that doesn't work - please upgrade!") % (libmproxy.version.VERSION, + netlib.version.VERSION) parser = argparse.ArgumentParser(usage = "%(prog)s [options] [filter]") - parser.add_argument('--version', action='version', version="mitmdump" + " " + version.VERSION) + parser.add_argument('--version', action='version', version="mitmdump" + " " + libmproxy.version.VERSION) cmdline.common_options(parser) parser.add_argument( "--keepserving", @@ -1,12 +1,18 @@ #!/usr/bin/env python import sys, argparse, os -from libmproxy import proxy, console, cmdline, version +from libmproxy import proxy, console, cmdline +import libmproxy.version, netlib.version from libmproxy.console import palettes if __name__ == '__main__': + # We don't introduce backward-incompatible changes in patch versions. Only consider major and minor version. + if netlib.version.IVERSION[:2] != libmproxy.version.IVERSION[:2]: + print >> sys.stderr, ("warning: You are using mitmproxy %s with netlib %s. " + "Most likely, that doesn't work - please upgrade!") % (libmproxy.version.VERSION, + netlib.version.VERSION) parser = argparse.ArgumentParser(usage = "%(prog)s [options]") - parser.add_argument('--version', action='version', version=version.NAMEVERSION) + parser.add_argument('--version', action='version', version=libmproxy.version.NAMEVERSION) cmdline.common_options(parser) parser.add_argument("--debug", dest="debug", default=False, action="store_true") parser.add_argument( |