From fb98cd0fc870c8a86f0595a5ccf1e4c65fc8ec84 Mon Sep 17 00:00:00 2001 From: Jeroen Van Goey Date: Mon, 9 Dec 2013 00:25:07 +0100 Subject: [PATCH 1/2] remove duplicate code There was twice a check for the Python version on OSX but the logging in the second step could never be reached. --- src/bitmessagemain.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 6caf0c98..1f9c4c5f 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -20,8 +20,9 @@ import os import sys if sys.platform == 'darwin': if float("{1}.{2}".format(*sys.version_info)) < 7.5: - print "You should use python 2.7.5 or greater." - print "Your version: {0}.{1}.{2}".format(*sys.version_info) + msg = "You should use python 2.7.5 or greater. Your version: %s", "{0}.{1}.{2}".format(*sys.version_info) + logger.critical(msg) + print msg sys.exit(0) # Classes @@ -41,12 +42,6 @@ import proofofwork str_chan = '[chan]' -import sys -if sys.platform == 'darwin': - if float("{1}.{2}".format(*sys.version_info)) < 7.5: - logger.critical("You should use python 2.7.5 or greater. Your version: %s", "{0}.{1}.{2}".format(*sys.version_info)) - sys.exit(0) - def connectToStream(streamNumber): shared.streamsInWhichIAmParticipating[streamNumber] = 'no data' selfInitiatedConnections[streamNumber] = {} -- 2.45.1 From 90b0d4c6408ce271e4fd0231e7c8c77bf53f6a8f Mon Sep 17 00:00:00 2001 From: Jeroen Van Goey Date: Mon, 9 Dec 2013 00:32:19 +0100 Subject: [PATCH 2/2] remove duplicate code There was twice a check for the Python version on OSX, but the logging in the second check was never reached --- src/bitmessagemain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 1f9c4c5f..beefabf2 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -20,8 +20,8 @@ import os import sys if sys.platform == 'darwin': if float("{1}.{2}".format(*sys.version_info)) < 7.5: - msg = "You should use python 2.7.5 or greater. Your version: %s", "{0}.{1}.{2}".format(*sys.version_info) - logger.critical(msg) + msg = "You should use python 2.7.5 or greater. Your version: %s", "{0}.{1}.{2}".format(*sys.version_info) + logger.critical(msg) print msg sys.exit(0) -- 2.45.1