зеркало из https://github.com/github/codeql.git
Python: Clean whitespace
This commit is contained in:
Родитель
3bdc92ba8e
Коммит
a9694bf0ef
|
@ -18,7 +18,7 @@ def return_in_finally(seq, x):
|
|||
finally:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
#Break in loop in finally
|
||||
#This is OK
|
||||
def return_in_loop_in_finally(f, seq):
|
||||
|
@ -27,7 +27,7 @@ def return_in_loop_in_finally(f, seq):
|
|||
finally:
|
||||
for i in seq:
|
||||
break
|
||||
|
||||
|
||||
#But this is not
|
||||
def return_in_loop_in_finally(f, seq):
|
||||
try:
|
||||
|
@ -49,7 +49,7 @@ class NonIterator(object):
|
|||
|
||||
for x in NonIterator():
|
||||
do_something(x)
|
||||
|
||||
|
||||
#None in for loop
|
||||
|
||||
def dodgy_iter(x):
|
||||
|
@ -91,8 +91,8 @@ for z in D():
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def modification_of_locals():
|
||||
x = 0
|
||||
locals()['x'] = 1
|
||||
|
@ -128,7 +128,7 @@ class classproperty(object):
|
|||
return self.getter(instance_type)
|
||||
|
||||
class WithClassProperty(object):
|
||||
|
||||
|
||||
@classproperty
|
||||
def x(self):
|
||||
return [0]
|
||||
|
@ -143,13 +143,13 @@ for i in WithClassProperty.x:
|
|||
#Should use context mamager
|
||||
|
||||
class CM(object):
|
||||
|
||||
|
||||
def __enter__(self):
|
||||
pass
|
||||
|
||||
|
||||
def __exit__(self, ex, cls, tb):
|
||||
pass
|
||||
|
||||
|
||||
def write(self, data):
|
||||
pass
|
||||
|
||||
|
@ -168,4 +168,3 @@ def assert_ok(seq):
|
|||
# False positive. ODASA-8042. Fixed in PR #2401.
|
||||
class false_positive:
|
||||
e = (x for x in [])
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче