Skip to content

Problem with python 3.7 and "async" as parameter name #558

Closed
@amoralej

Description

@amoralej

In python 3.7, async is a reserved keyword [1]. This module is using async as parameter name in different methods and it's failing with syntax errors like (excerpt):

File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/admissionregistration_api.py", line 120
async=params.get('async'),
^
SyntaxError: invalid syntax

byte-compiling /tmp/test/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/storage_v1alpha1_api.py to storage_v1alpha1_api.cpython-37.pyc
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/storage_v1alpha1_api.py", line 132
async=params.get('async'),
^
SyntaxError: invalid syntax

byte-compiling /tmp/test/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/autoscaling_api.py to autoscaling_api.cpython-37.pyc
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/autoscaling_api.py", line 120
async=params.get('async'),
^
SyntaxError: invalid syntax

Note that python 3.7 was released recently and some distros (as fedora) will be switching to it.

[1] https://docs.python.org/3.7/whatsnew/3.7.html#summary-release-highlights

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