mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
fix if not xxx:
stmt
This commit is contained in:
parent
0249f2bf75
commit
e41c5f2594
@ -73,8 +73,14 @@ def compare_strings(s1, s2):
|
||||
else:
|
||||
return False
|
||||
|
||||
def is_string_not_empty(s):
|
||||
if not s:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
assert compare_strings('abc', 'abc') == True
|
||||
assert compare_strings('abc', 'def') == False
|
||||
assert is_string_not_empty('abc') == True
|
||||
|
||||
print("PASS")
|
||||
|
@ -73,8 +73,14 @@ def compare_strings(s1, s2):
|
||||
else:
|
||||
return False
|
||||
|
||||
def is_string_not_empty(s):
|
||||
if not s:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
assert compare_strings('abc', 'abc') == True
|
||||
assert compare_strings('abc', 'def') == False
|
||||
assert is_string_not_empty('abc') == True
|
||||
|
||||
print("PASS")
|
||||
|
@ -3010,7 +3010,9 @@ static Arg* VM_instruction_handler_OPT(PikaObj* self,
|
||||
}
|
||||
if (data[0] == ' ' && data[1] == 'n' && data[2] == 'o' && data[3] == 't' &&
|
||||
data[4] == ' ' && data[5] == 0) {
|
||||
op.res = arg_setBool(op.res, "", !op.i2);
|
||||
pika_bool bTrue = pika_false;
|
||||
_transeBool(op.a2, &bTrue);
|
||||
op.res = arg_setBool(op.res, "", !bTrue);
|
||||
goto __exit;
|
||||
}
|
||||
pika_platform_printf("Error: unknown operator '%s'\n", data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user