prevent closing sys.stdin or sys.stdout
This commit is contained in:
parent
38992fdc37
commit
858fe7e897
|
@ -77,7 +77,7 @@ class ASCIItable():
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
def input_close(self):
|
def input_close(self):
|
||||||
try:
|
try:
|
||||||
self.__IO__['in'].close()
|
if self.__IO__['in'] != sys.stdin: self.__IO__['in'].close()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ class ASCIItable():
|
||||||
def output_close(self,
|
def output_close(self,
|
||||||
dismiss = False):
|
dismiss = False):
|
||||||
try:
|
try:
|
||||||
self.__IO__['out'].close()
|
if self.__IO__['out'] != sys.stdout: self.__IO__['out'].close()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
if dismiss and os.path.isfile(self.__IO__['out'].name): os.remove(self.__IO__['out'].name)
|
if dismiss and os.path.isfile(self.__IO__['out'].name): os.remove(self.__IO__['out'].name)
|
||||||
|
|
Loading…
Reference in New Issue