Redirect to devnull stdout and stderr under py2exe for issue1030

(transplanted from 208628d488573e05f8de36fb3a43b1f090adf42e)
This commit is contained in:
Cédric Krier
2009-11-11 00:07:05 +01:00
parent 7b4d3cad91
commit 22e93e271a
+5
View File
@@ -8,6 +8,11 @@ try:
except:
pass
# True only if running as a py2exe app
if os.name == 'nt' and hasattr(sys, "frozen"):
sys.stdout = open(os.devnull, 'w')
sys.stderr = open(os.devnull, 'w')
if os.name == 'mac' or \
(hasattr(os, 'uname') and os.uname()[0] == 'Darwin'):
resources = os.path.join(os.path.dirname(sys.argv[0]), '..', 'Resources')