mirror of
https://github.com/github/codeql.git
synced 2026-07-10 14:05:41 +02:00
Python: Add parser support for lazy imports
As defined in PEP-810. We implement this in much the same way as how we handle `async` annotations currently. The relevant nodes get an `is_lazy` field that defaults to being false.
This commit is contained in:
@@ -72,8 +72,8 @@ class AstDumper(object):
|
||||
# just not print it in that case.
|
||||
if field == "parenthesised" and value is None:
|
||||
continue
|
||||
# Likewise, the default value for `is_async` is `False`, so we don't need to print it.
|
||||
if field == "is_async" and value is False:
|
||||
# Likewise, the default value for `is_async` and `is_lazy` is `False`, so we don't need to print it.
|
||||
if field in ("is_async", "is_lazy") and value is False:
|
||||
continue
|
||||
output.write("{} {}:".format(indent,field))
|
||||
if isinstance(value, list):
|
||||
|
||||
Reference in New Issue
Block a user