From 8c73587a800ebbd80cb2243ae279f8723680965f Mon Sep 17 00:00:00 2001 From: stevenknight Date: Tue, 28 Oct 2008 01:00:25 +0000 Subject: [PATCH] Issue 2228: Add os.devnull to the SCons.compat layer. git-svn-id: http://scons.tigris.org/svn/scons/trunk@3741 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- 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 9a58dc67..cc48ce3d 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 -- 2.26.2