mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
This patch changes a few of the scripts to have __name__=='__main__' clauses so that they are importable without running. Also fixes the syntax errors revealed by the tests.
This commit is contained in:
parent
b6046301ef
commit
54ac832a24
7 changed files with 128 additions and 82 deletions
|
@ -106,14 +106,16 @@ def check_limit(n, test_func_name):
|
|||
else:
|
||||
print("Yikes!")
|
||||
|
||||
limit = 1000
|
||||
while 1:
|
||||
check_limit(limit, "test_recurse")
|
||||
check_limit(limit, "test_add")
|
||||
check_limit(limit, "test_repr")
|
||||
check_limit(limit, "test_init")
|
||||
check_limit(limit, "test_getattr")
|
||||
check_limit(limit, "test_getitem")
|
||||
check_limit(limit, "test_cpickle")
|
||||
print("Limit of %d is fine" % limit)
|
||||
limit = limit + 100
|
||||
if __name__ == '__main__':
|
||||
|
||||
limit = 1000
|
||||
while 1:
|
||||
check_limit(limit, "test_recurse")
|
||||
check_limit(limit, "test_add")
|
||||
check_limit(limit, "test_repr")
|
||||
check_limit(limit, "test_init")
|
||||
check_limit(limit, "test_getattr")
|
||||
check_limit(limit, "test_getitem")
|
||||
check_limit(limit, "test_cpickle")
|
||||
print("Limit of %d is fine" % limit)
|
||||
limit = limit + 100
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue