mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[Patch #1005491 ] use __name__ == '__main__' in scripts
This commit is contained in:
parent
6c542b731c
commit
e236b38731
34 changed files with 257 additions and 200 deletions
|
@ -109,8 +109,9 @@ def askyesno(prompt):
|
|||
s = raw_input(prompt)
|
||||
return s in ['y', 'yes']
|
||||
|
||||
try:
|
||||
setup()
|
||||
go(getargs())
|
||||
except KeyboardInterrupt:
|
||||
print '[Intr]'
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
setup()
|
||||
go(getargs())
|
||||
except KeyboardInterrupt:
|
||||
print '[Intr]'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue