So, here I am, playing around with the ipfsapi in python and yesterday, to start somewhere, I ran some code from the following blogpost that connects to the local node: https://medium.com/python-pandemonium/getting-started-with-python-and-ipfs-94d14fdffd10
Last night it worked perfectly, but today when I began a new project where I would actually use this method and rewrote the code, I got an invalid syntax error in the except statement. Right now the code looks like this
if __name__ == '__main__':
try:
api = ipfshttpclient.connect('127.0.0.1', 5001)
print(api)
except: ipfshttpclient.exceptions.ConnectionError as ce: #the invalid syntax error is marked at as
print(str(ce))
Traceback:
File "/home/", line 17
except: ipfshttpclient.exceptions.ConnectionError as ce:
^
SyntaxError: invalid syntax
The odd thing is that I'm getting an invalid syntax error on the as. I've changed ipfsapi due to deprecation warning to ipfshttpclient, but it doesn't work with either now, same erreor. How is that even possible? Am I just not seeing something I should? Is my brain smoothing out? Sorry if it's a dumb issue and thanks in advance!
Python 3.7.4 64-bit | Qt 5.9.6 | PyQt5 5.9.2 | Linux 5.5.10-arch1-1