mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-21 05:37:05 +08:00
Test fixes and for loops need to be handled a awell in flow_analysis.
This commit is contained in:
1 parent
0ae9e520c1
commit
01bdd1e4fa
3 files changed
+5
-3
No files matched your search
@@ -65,3 +65,5 @@ def _check_flow(evaluator, flow):
|
|||||||
return UNSURE
|
return UNSURE
|
||||||
elif flow.command in ('try', 'except', 'finally', 'while'):
|
elif flow.command in ('try', 'except', 'finally', 'while'):
|
||||||
return UNSURE
|
return UNSURE
|
||||||
|
else: # for loop
|
||||||
|
return REACHABLE
|
||||||
@@ -269,7 +269,7 @@ class MethodDecoratorDoesntExist(Base):
|
|||||||
# -----------------
|
# -----------------
|
||||||
def memoize(function):
|
def memoize(function):
|
||||||
def wrapper(*args):
|
def wrapper(*args):
|
||||||
if 1:
|
if random.choice([0, 1]):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
rv = function(*args)
|
rv = function(*args)
|
||||||
|
|||||||
@@ -318,8 +318,8 @@ blub()[0]
|
|||||||
|
|
||||||
# with else clause
|
# with else clause
|
||||||
def blub():
|
def blub():
|
||||||
if 1:
|
if random.choice([0, 1]):
|
||||||
1
|
1
|
||||||
else:
|
else:
|
||||||
a = []
|
a = []
|
||||||
a.append(1)
|
a.append(1)
|
||||||
|
|||||||
Reference in new issue
Block a user