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

[matter_yamltests] Try to not convert strings that represent a variab… #24751

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/py_matter_yamltests/matter_yamltests/fixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,15 @@ def try_apply_yaml_unrepresentable_integer_for_javascript_fixes(value):
JavaScript can not represent integers bigger than 9007199254740991. But some of the test may
uses values that are bigger than this. The current way to workaround this limitation has
been to write those numbers as strings by encapsulating them in "".
Conversion happens on a best effort basis. For example, the type of value can be a string
because a variable has been used, in which case, it would not convert to a proper int
and we would fail at runtime.
'''
if type(value) is str:
value = int(value)
try:
value = int(value)
except:
pass
return value


Expand Down