Skip to content

Commit 81c9115

Browse files
committed
Fix error #21
1 parent c9e1b8a commit 81c9115

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

cryptolens_python2.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ def activate(token, rsa_pub_key, product_id, key, machine_code, fields_to_return
236236
except HTTPError as e:
237237
response = Response.from_string(e.read())
238238
except URLError as e:
239-
return (None, "Could not contact the server. Error message: " + e.reason)
239+
return (None, "Could not contact the server. Error message: " + str(e))
240240
except Exception:
241-
return (None, "Could not contact the server. Error message: " + e.reason)
241+
return (None, "Could not contact the server.")
242242

243243
pubkey = RSAPublicKey.from_string(rsa_pub_key)
244244

@@ -279,9 +279,9 @@ def get_key(token, rsa_pub_key, product_id, key, fields_to_return = 0,\
279279
except HTTPError as e:
280280
response = Response.from_string(e.read())
281281
except URLError as e:
282-
return (None, "Could not contact the server. Error message: " + e.reason)
282+
return (None, "Could not contact the server. Error message: " + str(e))
283283
except Exception:
284-
return (None, "Could not contact the server. Error message: " + e.reason)
284+
return (None, "Could not contact the server.")
285285

286286
pubkey = RSAPublicKey.from_string(rsa_pub_key)
287287

@@ -315,9 +315,9 @@ def create_trial_key(token, product_id, machine_code):
315315
except HTTPError as e:
316316
response = Response.from_string(e.read())
317317
except URLError as e:
318-
return (None, "Could not contact the server. Error message: " + e.reason)
318+
return (None, "Could not contact the server. Error message: " + str(e))
319319
except Exception:
320-
return (None, "Could not contact the server. Error message: " + e.reason)
320+
return (None, "Could not contact the server.")
321321

322322
jobj = json.loads(response)
323323

@@ -353,9 +353,9 @@ def deactivate(token, product_id, key, machine_code, floating = False):
353353
except HTTPError as e:
354354
response = Response.from_string(e.read())
355355
except URLError as e:
356-
return (None, "Could not contact the server. Error message: " + e.reason)
356+
return (None, "Could not contact the server. Error message: " + str(e))
357357
except Exception:
358-
return (None, "Could not contact the server. Error message: " + e.reason)
358+
return (None, "Could not contact the server.")
359359

360360
jobj = json.loads(response)
361361

licensing/methods.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def activate(token, rsa_pub_key, product_id, key, machine_code, fields_to_return
5050
except HTTPError as e:
5151
response = Response.from_string(e.read())
5252
except URLError as e:
53-
return (None, "Could not contact the server. Error message: " + e.reason)
53+
return (None, "Could not contact the server. Error message: " + str(e))
5454
except Exception:
55-
return (None, "Could not contact the server. Error message: " + e.reason)
55+
return (None, "Could not contact the server.")
5656

5757
pubkey = RSAPublicKey.from_string(rsa_pub_key)
5858

@@ -93,9 +93,9 @@ def get_key(token, rsa_pub_key, product_id, key, fields_to_return = 0,\
9393
except HTTPError as e:
9494
response = Response.from_string(e.read())
9595
except URLError as e:
96-
return (None, "Could not contact the server. Error message: " + e.reason)
96+
return (None, "Could not contact the server. Error message: " + str(e))
9797
except Exception:
98-
return (None, "Could not contact the server. Error message: " + e.reason)
98+
return (None, "Could not contact the server.")
9999

100100
pubkey = RSAPublicKey.from_string(rsa_pub_key)
101101

@@ -129,9 +129,9 @@ def create_trial_key(token, product_id, machine_code):
129129
except HTTPError as e:
130130
response = Response.from_string(e.read())
131131
except URLError as e:
132-
return (None, "Could not contact the server. Error message: " + e.reason)
132+
return (None, "Could not contact the server. Error message: " + str(e))
133133
except Exception:
134-
return (None, "Could not contact the server. Error message: " + e.reason)
134+
return (None, "Could not contact the server.")
135135

136136
jobj = json.loads(response)
137137

@@ -164,9 +164,9 @@ def deactivate(token, product_id, key, machine_code, floating = False):
164164
except HTTPError as e:
165165
response = Response.from_string(e.read())
166166
except URLError as e:
167-
return (None, "Could not contact the server. Error message: " + e.reason)
167+
return (None, "Could not contact the server. Error message: " + str(e))
168168
except Exception:
169-
return (None, "Could not contact the server. Error message: " + e.reason)
169+
return (None, "Could not contact the server.")
170170

171171
jobj = json.loads(response)
172172

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.17', # Start with a small number and increase it with every change you make
5+
version = '0.18', # 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 = 'support@cryptolens.io', # 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_17.tar.gz', # I explain this later on
11+
download_url = 'https://github.com/Cryptolens/cryptolens-python/archive/v_18.tar.gz', # I explain this later on
1212
keywords = ['software licensing', 'licensing library', 'cryptolens'], # Keywords that define your package best
1313
classifiers=[
1414
#'Development Status :: 5 - Stable', # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package

0 commit comments

Comments
 (0)