prevent closing sys.stdin or sys.stdout

This commit is contained in:
Philip Eisenlohr 2015-08-24 00:40:52 +00:00
parent 38992fdc37
commit 858fe7e897
1 changed files with 2 additions and 2 deletions

View File

@ -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)