From 7f022014954882e106d244f98ae0205108fc6aa5 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Tue, 28 Oct 2008 01:00:25 +0000 Subject: Issue 2228: Add os.devnull to the SCons.compat layer. --- src/engine/SCons/compat/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/engine/SCons/compat/__init__.py b/src/engine/SCons/compat/__init__.py index 9a58dc6..cc48ce3 100644 --- a/src/engine/SCons/compat/__init__.py +++ b/src/engine/SCons/compat/__init__.py @@ -155,6 +155,19 @@ except ImportError: # Pre-2.3 Python has no optparse module. import_as('_scons_optparse', 'optparse') +import os +try: + os.devnull +except AttributeError: + # Pre-2.4 Python has no os.devnull attribute + import sys + _names = sys.builtin_module_names + if 'posix' in _names: + os.devnull = '/dev/null' + elif 'nt' in _names: + os.devnull = 'nul' + os.path.devnull = os.devnull + import shlex try: shlex.split -- cgit v0.12