From 22e93e271a8c2f3ee276eca3fc1cc14ae94e6f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 11 Nov 2009 00:07:05 +0100 Subject: [PATCH] Redirect to devnull stdout and stderr under py2exe for issue1030 (transplanted from 208628d488573e05f8de36fb3a43b1f090adf42e) --- bin/tryton | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/tryton b/bin/tryton index 1ba3e56543..e94f01c97b 100755 --- a/bin/tryton +++ b/bin/tryton @@ -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')