Skip to content

Commit 47ec255

Browse files
committed
removed else exception, no auth is passed by internal algo API processing
1 parent 6e01553 commit 47ec255

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

Algorithmia/client.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ def postJsonHelper(self, url, input_object, parse_response_as_json=True, **query
225225
headers['Authorization'] = self.apiKey
226226
elif self.bearerToken is not None:
227227
headers['Authorization'] = 'Bearer ' + self.bearerToken
228-
else:
229-
raise Exception("No authentication provided")
230228

231229
input_json = None
232230
if input_object is None:
@@ -266,8 +264,6 @@ def getStreamHelper(self, url, **query_parameters):
266264
headers['Authorization'] = self.apiKey
267265
elif self.bearerToken is not None:
268266
headers['Authorization'] = 'Bearer ' + self.bearerToken
269-
else:
270-
raise Exception("No authentication provided")
271267
return self.requestSession.get(self.apiAddress + url, headers=headers, params=query_parameters, stream=True)
272268

273269
def patchHelper(self, url, params):
@@ -276,8 +272,6 @@ def patchHelper(self, url, params):
276272
headers['Authorization'] = self.apiKey
277273
elif self.bearerToken is not None:
278274
headers['Authorization'] = 'Bearer ' + self.bearerToken
279-
else:
280-
raise Exception("No authentication provided")
281275
return self.requestSession.patch(self.apiAddress + url, headers=headers, data=json.dumps(params))
282276

283277
# Used internally to get http head result
@@ -287,8 +281,6 @@ def headHelper(self, url):
287281
headers['Authorization'] = self.apiKey
288282
elif self.bearerToken is not None:
289283
headers['Authorization'] = 'Bearer ' + self.bearerToken
290-
else:
291-
raise Exception("No authentication provided")
292284
return self.requestSession.head(self.apiAddress + url, headers=headers)
293285

294286
# Used internally to http put a file
@@ -298,8 +290,6 @@ def putHelper(self, url, data):
298290
headers['Authorization'] = self.apiKey
299291
elif self.bearerToken is not None:
300292
headers['Authorization'] = 'Bearer ' + self.bearerToken
301-
else:
302-
raise Exception("No authentication provided")
303293
if isJson(data):
304294
headers['Content-Type'] = 'application/json'
305295

@@ -315,8 +305,6 @@ def deleteHelper(self, url):
315305
headers['Authorization'] = self.apiKey
316306
elif self.bearerToken is not None:
317307
headers['Authorization'] = 'Bearer ' + self.bearerToken
318-
else:
319-
raise Exception("No authentication provided")
320308
response = self.requestSession.delete(self.apiAddress + url, headers=headers)
321309
if response.reason == "No Content":
322310
return response

0 commit comments

Comments
 (0)