Skip to content

Commit 2107ab4

Browse files
committed
Fix machine code generation on Mac for Python 2 & 3
1 parent 38e63ba commit 2107ab4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cryptolens_python2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def GetMachineCode():
292292
return HelperMethods.get_SHA256(HelperMethods.start_process(["cmd.exe", "/C", "wmic","csproduct", "get", "uuid"]))
293293
elif "darwin" in platform.platform().lower():
294294
res = HelperMethods.start_process(["system_profiler","SPHardwareDataType"]).decode('utf-8')
295-
HelperMethods.get_SHA256(res[res.index("UUID"):].strip())
295+
return HelperMethods.get_SHA256(res[res.index("UUID"):].strip())
296296
elif "linux" in platform.platform(HelperMethods.compute_machine_code()):
297297
return HelperMethods.get_SHA256(HelperMethods.compute_machine_code())
298298
else:

licensing/methods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ def GetMachineCode():
134134
if "windows" in platform.platform().lower():
135135
return HelperMethods.get_SHA256(HelperMethods.start_process(["cmd.exe", "/C", "wmic","csproduct", "get", "uuid"]))
136136
elif "mac" in platform.platform().lower() or "darwin" in platform.platform().lower():
137-
res = HelperMethods.start_process(["system_profiler","SPHardwareDataType"]).decode('utf-8')
138-
HelperMethods.get_SHA256(res[res.index("UUID"):].strip())
137+
res = HelperMethods.start_process(["system_profiler","SPHardwareDataType"])
138+
return HelperMethods.get_SHA256(res[res.index("UUID"):].strip())
139139
elif "linux" in platform.platform().lower() :
140140
return HelperMethods.get_SHA256(HelperMethods.compute_machine_code())
141141
else:

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
setup(
33
name = 'licensing', # How you named your package folder (MyLib)
44
packages = ['licensing'], # Chose the same as "name"
5-
version = '0.11', # Start with a small number and increase it with every change you make
5+
version = '0.12', # Start with a small number and increase it with every change you make
66
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
77
description = 'Client library for Cryptolens licensing Web API.', # Give a short description about your library
88
author = 'Cryptolens AB', # Type in your name
99
author_email = '[email protected]', # Type in your E-Mail
1010
url = 'https://cryptolens.io', # Provide either the link to your github or to your website
11-
download_url = 'https://github.com/Cryptolens/cryptolens-python/archive/v_10.tar.gz', # I explain this later on
11+
download_url = 'https://github.com/Cryptolens/cryptolens-python/archive/v_12.tar.gz', # I explain this later on
1212
keywords = ['software licensing', 'licensing library', 'cryptolens'], # Keywords that define your package best
1313
install_requires=[ # I get to this in a second
1414
'pycryptodome'

0 commit comments

Comments
 (0)