Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 compatibility #71

Open
rouxrei opened this issue May 29, 2018 · 1 comment
Open

python3 compatibility #71

rouxrei opened this issue May 29, 2018 · 1 comment

Comments

@rouxrei
Copy link

rouxrei commented May 29, 2018

I installed cm-api for python3 using pip without issues

pip install cm-api

However, following the example on the website , I immediately get an error:

>>> from cm_api.api_client import ApiResource
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Python\lib\site-packages\cm_api\api_client.py", line 23, in <module>
    from cm_api.http_client import HttpClient, RestException
  File "C:\Program Files\Python\lib\site-packages\cm_api\http_client.py", line 182
    except urllib2.HTTPError, ex:
                            ^
SyntaxError: invalid syntax

The error is obvious, python3 does not allow ','(comma) as syntax to declare an alias of an exception.

It seems cm-api is NOT compatible with python3 since this commit: dcc11df
I could not find a reason for reverting the compatibility.

So either this lib should be removed from the pip3 repositories or this commit should be 'unreverted'?

@vojtechspacir
Copy link

Still a problem more than year after initial report.

Did anyone find a workaround other that using Ansible controller executable running on Python2.7?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants