Remove additional traceback print

This commit is contained in:
Lorenz Diener 2017-04-25 11:36:49 +02:00
pare 6f48c15431
commit 5aeb953d24

Veure arxiu

@ -67,8 +67,6 @@ class Mastodon:
response = requests.post(api_base_url + '/api/v1/apps', data = request_data, timeout = request_timeout) response = requests.post(api_base_url + '/api/v1/apps', data = request_data, timeout = request_timeout)
response = response.json() response = response.json()
except Exception as e: except Exception as e:
import traceback
traceback.print_exc()
raise MastodonNetworkError("Could not complete request: %s" % e) raise MastodonNetworkError("Could not complete request: %s" % e)
if to_file != None: if to_file != None:
@ -219,8 +217,6 @@ class Mastodon:
self.refresh_token = response.get('refresh_token') self.refresh_token = response.get('refresh_token')
self.token_expired = int(response.get('expires_in', 0)) self.token_expired = int(response.get('expires_in', 0))
except Exception as e: except Exception as e:
import traceback
traceback.print_exc()
if username is not None or password is not None: if username is not None or password is not None:
raise MastodonIllegalArgumentError('Invalid user name, password, or redirect_uris: %s' % e) raise MastodonIllegalArgumentError('Invalid user name, password, or redirect_uris: %s' % e)
elif code is not None: elif code is not None:
@ -505,8 +501,6 @@ class Mastodon:
else: else:
media_ids_proper.append(media_id) media_ids_proper.append(media_id)
except Exception as e: except Exception as e:
import traceback
traceback.print_exc()
raise MastodonIllegalArgumentError("Invalid media dict: %s" % e) raise MastodonIllegalArgumentError("Invalid media dict: %s" % e)
params_initial["media_ids"] = media_ids_proper params_initial["media_ids"] = media_ids_proper
@ -763,8 +757,6 @@ class Mastodon:
if method == 'DELETE': if method == 'DELETE':
response_object = requests.delete(self.api_base_url + endpoint, data = params, headers = headers, files = files, timeout = self.request_timeout) response_object = requests.delete(self.api_base_url + endpoint, data = params, headers = headers, files = files, timeout = self.request_timeout)
except Exception as e: except Exception as e:
import traceback
traceback.print_exc()
raise MastodonNetworkError("Could not complete request: %s" % e) raise MastodonNetworkError("Could not complete request: %s" % e)
if response_object == None: if response_object == None:
@ -785,8 +777,6 @@ class Mastodon:
try: try:
response = response_object.json() response = response_object.json()
except: except:
import traceback
traceback.print_exc()
raise MastodonAPIError("Could not parse response as JSON, response code was %s, bad json content was '%s'" % (response_object.status_code, response_object.content)) raise MastodonAPIError("Could not parse response as JSON, response code was %s, bad json content was '%s'" % (response_object.status_code, response_object.content))
# Handle rate limiting # Handle rate limiting
@ -805,8 +795,6 @@ class Mastodon:
self.ratelimit_reset += server_time_diff self.ratelimit_reset += server_time_diff
self.ratelimit_lastcall = time.time() self.ratelimit_lastcall = time.time()
except Exception as e: except Exception as e:
import traceback
traceback.print_exc()
raise MastodonRatelimitError("Rate limit time calculations failed: %s" % e) raise MastodonRatelimitError("Rate limit time calculations failed: %s" % e)
if "error" in response and response["error"] == "Throttled": if "error" in response and response["error"] == "Throttled":