Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Error in reponse code checking due to operator precedence #2

Copy link
Copy link
@solarjoe

Description

@solarjoe
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.