Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Commit c97dc21

Browse files
committed
Merge pull request #11 from karma0/python3
Fixed to run on Python versions 2 and 3
2 parents 75fe5c9 + 651a28a commit c97dc21

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

alchemyapi.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,12 @@ def __analyze(self, endpoint, params, post_data=bytearray()):
737737
params['outputMode'] = 'json'
738738
# Insert the base url
739739

740-
post_url = AlchemyAPI.BASE_URL + endpoint + \
741-
'?' + urlencode(params).encode('utf-8')
740+
post_url = ""
741+
try:
742+
post_url = AlchemyAPI.BASE_URL + endpoint + \
743+
'?' + urlencode(params).encode('utf-8')
744+
except TypeError:
745+
post_url = AlchemyAPI.BASE_URL + endpoint + '?' + urlencode(params)
742746

743747
results = ""
744748
try:

0 commit comments

Comments
 (0)