Skip to content

Commit a3d21dc

Browse files
author
Jonathan Warren
committed
Merge pull request #280 from RemideZ/master
macOSX compatibility
2 parents 12c3aac + 68b2350 commit a3d21dc

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/bitmessagemain.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@
3535
import helper_startup
3636
import helper_bootstrap
3737

38+
import sys
39+
if sys.platform == 'darwin':
40+
if float( "{1}.{2}".format(*sys.version_info) ) < 7.5:
41+
print "You should use python 2.7.5 or greater."
42+
print "Your version: {0}.{1}.{2}".format(*sys.version_info)
43+
sys.exit(0)
44+
3845
def connectToStream(streamNumber):
3946
selfInitiatedConnections[streamNumber] = {}
4047
if sys.platform[0:3] == 'win':

src/bitmessageqt/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,8 +2954,11 @@ def run():
29542954
app = QtGui.QApplication(sys.argv)
29552955
translator = QtCore.QTranslator()
29562956

2957-
translator.load("translations/bitmessage_" + str(locale.getlocale()[0]))
2958-
#translator.load("translations/bitmessage_fr_BE") # Try French instead
2957+
try:
2958+
translator.load("translations/bitmessage_" + str(locale.getlocale()[0]))
2959+
except:
2960+
# The above is not compatible with all versions of OSX.
2961+
translator.load("translations/bitmessage_en_US") # Default to english.
29592962

29602963
QtGui.QApplication.installTranslator(translator)
29612964
app.setStyleSheet("QStatusBar::item { border: 0px solid black }")

src/pyelliptic/openssl.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,12 @@ def __init__(self, library):
289289
self.HMAC.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int,
290290
ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p]
291291

292-
self.PKCS5_PBKDF2_HMAC = self._lib.PKCS5_PBKDF2_HMAC
292+
try:
293+
self.PKCS5_PBKDF2_HMAC = self._lib.PKCS5_PBKDF2_HMAC
294+
except:
295+
# The above is not compatible with all versions of OSX.
296+
self.PKCS5_PBKDF2_HMAC = self._lib.PKCS5_PBKDF2_HMAC_SHA1
297+
293298
self.PKCS5_PBKDF2_HMAC.restype = ctypes.c_int
294299
self.PKCS5_PBKDF2_HMAC.argtypes = [ctypes.c_void_p, ctypes.c_int,
295300
ctypes.c_void_p, ctypes.c_int,

0 commit comments

Comments
 (0)