@@ -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
0 commit comments