[jhbuild] use NUL instead of /dev/null on win32
- From: Frederic Peters <fpeters src gnome org>
- To: svn-commits-list gnome org
- Subject: [jhbuild] use NUL instead of /dev/null on win32
- Date: Thu, 21 May 2009 13:50:14 -0400 (EDT)
commit 08d2dd26466498cc1b0a8272c531c8ca17acbbb8
Author: Frédéric Péters <fpeters 0d be>
Date: Thu May 21 19:46:24 2009 +0200
use NUL instead of /dev/null on win32
---
tests/tests.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/tests/tests.py b/tests/tests.py
index 73eed1a..0a8b009 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -565,8 +565,11 @@ def restore_environ(env):
STDOUT_FILENO = 1
def with_stdout_hidden(func):
+ null_device = '/dev/null'
+ if sys.platform.startswith('win'):
+ null_device = 'NUL'
old_fd = os.dup(STDOUT_FILENO)
- new_fd = os.open('/dev/null', os.O_WRONLY)
+ new_fd = os.open(null_device, os.O_WRONLY)
os.dup2(new_fd, STDOUT_FILENO)
os.close(new_fd)
try:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]