forked from rocky/python-uncompyle6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path15_assert.py
More file actions
29 lines (22 loc) · 696 Bytes
/
15_assert.py
File metadata and controls
29 lines (22 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Tests:
# 2.7:
# assert ::= assert_expr jmp_true LOAD_ASSERT RAISE_VARARGS_1
# call_function ::= expr expr expr CALL_FUNCTION_2
# 2.6
# assert ::= assert_expr jmp_true LOAD_ASSERT RAISE_VARARGS_1 come_from_pop
assert isinstance(1, int)
# 2.6.9 DocXMLRPCServer.py
# 2.6
# assert2 ::= assert_expr jmp_true LOAD_ASSERT expr RAISE_VARARGS_2 come_from_pop
for method_name in ['a']:
if method_name in ('b',):
method = 'a'
else:
assert 0, "instance installed"
methods = 'b'
# _Bug in 3.x is not recognizing the assert
# producing:
# if not not do_setlocal:
# raise AssertError
def getpreferredencoding(do_setlocale=True):
assert not do_setlocale