We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This check does not work as expected as is always True:
True
if response.status_code == 200 or 201:
https://github.com/SoftwareAG/cumulocity-python-agent/blob/e3f697136584b2d609f88cd6c624f858dd4a0d98/deviceRegistration/newDeviceRegistration.py#L62
Because Python reads it as if (response.status_code == 200) or 201
if (response.status_code == 200) or 201
https://docs.python.org/3/reference/expressions.html#operator-precedence
The text was updated successfully, but these errors were encountered:
You would write is as if response.status_code in [200, 201]:
if response.status_code in [200, 201]:
Sorry, something went wrong.
No branches or pull requests
This check does not work as expected as is always
True
:if response.status_code == 200 or 201:
https://github.com/SoftwareAG/cumulocity-python-agent/blob/e3f697136584b2d609f88cd6c624f858dd4a0d98/deviceRegistration/newDeviceRegistration.py#L62
Because Python reads it as
if (response.status_code == 200) or 201
https://docs.python.org/3/reference/expressions.html#operator-precedence
The text was updated successfully, but these errors were encountered: