以下脚本:
import os
def call_close(fd):
try:
print fd
os.close(fd)
except Exception as e:
print 'Exception:', e
for fd in range(10):
call_close(fd)
打印
0
1
没有更多的信息,也没有例外。你猜会发生什么?