Skip to content

python bundle generator must escape 'async' as variable name #980

@ygorelik

Description

@ygorelik

Current Behavior

Usage of Python bundle package ydk-models-cisco-ios-xe exposed syntax error:

Traceback (most recent call last):
  File "scripts/tests/test_xe_get_config.py", line 5, in <module>
    from ydk.models.cisco_ios_xe.Cisco_IOS_XE_native import Native
  File "/Users/ygorelik/ydk-gen/venv/lib/python3.7/site-packages/ydk/models/cisco_ios_xe/Cisco_IOS_XE_native.py", line 774161
    self.async = Native.Interface.Cellular.Async()
             ^
SyntaxError: invalid syntax  

The error appears, because 'async' is reserved Python3 language word. This word must be escaped in the bundle code.

Steps to Reproduce

Any script that uses 'ydk.models.cisco_ios_xe.Cisco_IOS_XE_native.Native' class.

System Information

(venv) Yakovs-Air:ydk-gen ygorelik$ pip list | grep ydk
ydk 0.8.4.post1
ydk-models-cisco-ios-xe 16.9.3

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions