mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Merge pull request #2991 from BekaValentine/python-objectapi-to-valueapi-unguardednextingenerator
Python: ObjectAPI to ValueAPI: UnguardedNextInGenerator
This commit is contained in:
@@ -47,3 +47,9 @@ def next_in_comp(seq, fields):
|
||||
seq_iter = iter(seq)
|
||||
values = [ next(seq_iter) if f.attname in NAMES else DEFAULT for f in fields ]
|
||||
return values
|
||||
|
||||
def ok5(seq):
|
||||
yield next(iter([]), 'foo')
|
||||
|
||||
def ok6(seq):
|
||||
yield next(iter([]), default='foo')
|
||||
|
||||
Reference in New Issue
Block a user