# HG changeset patch # User Ross Lagerwall # Date 2012-08-04 05:14:40 # Node ID fc24c10424d2852160774468a6776fbf4af716bd # Parent 59581b667cd75537d0b90fc83b6e9dd77042272e util: replace util.nulldev with os.devnull Python since 2.4 has supported os.devnull so having util.nulldev is unnecessary. diff --git a/hgext/convert/common.py b/hgext/convert/common.py --- a/hgext/convert/common.py +++ b/hgext/convert/common.py @@ -276,9 +276,9 @@ class commandline(object): pass cmdline = [util.shellquote(arg) for arg in cmdline] if not self.ui.debugflag: - cmdline += ['2>', util.nulldev] + cmdline += ['2>', os.devnull] if closestdin: - cmdline += ['<', util.nulldev] + cmdline += ['<', os.devnull] cmdline = ' '.join(cmdline) return cmdline diff --git a/hgext/convert/gnuarch.py b/hgext/convert/gnuarch.py --- a/hgext/convert/gnuarch.py +++ b/hgext/convert/gnuarch.py @@ -184,7 +184,7 @@ class gnuarch_source(converter_source, c cmdline = [self.execmd, cmd] cmdline += args cmdline = [util.shellquote(arg) for arg in cmdline] - cmdline += ['>', util.nulldev, '2>', util.nulldev] + cmdline += ['>', os.devnull, '2>', os.devnull] cmdline = util.quotecommand(' '.join(cmdline)) self.ui.debug(cmdline, '\n') return os.system(cmdline) diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -515,7 +515,7 @@ def service(opts, parentfn=None, initfn= sys.stdout.flush() sys.stderr.flush() - nullfd = os.open(util.nulldev, os.O_RDWR) + nullfd = os.open(os.devnull, os.O_RDWR) logfilefd = nullfd if logfile: logfilefd = os.open(logfile, os.O_RDWR | os.O_CREAT | os.O_APPEND) diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -10,7 +10,6 @@ import encoding import os, sys, errno, stat, getpass, pwd, grp, tempfile, unicodedata posixfile = open -nulldev = '/dev/null' normpath = os.path.normpath samestat = os.path.samestat oslink = os.link diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -45,7 +45,6 @@ makedir = platform.makedir nlinks = platform.nlinks normpath = platform.normpath normcase = platform.normcase -nulldev = platform.nulldev openhardlinks = platform.openhardlinks oslink = platform.oslink parsepatchoutput = platform.parsepatchoutput diff --git a/mercurial/windows.py b/mercurial/windows.py --- a/mercurial/windows.py +++ b/mercurial/windows.py @@ -24,7 +24,6 @@ termwidth = win32.termwidth testpid = win32.testpid unlink = win32.unlink -nulldev = 'NUL:' umask = 0022 # wrap osutil.posixfile to provide friendlier exceptions @@ -174,7 +173,7 @@ def popen(command, mode='r'): # Work around "popen spawned process may not write to stdout # under windows" # http://bugs.python.org/issue1366 - command += " 2> %s" % nulldev + command += " 2> %s" % os.devnull return os.popen(quotecommand(command), mode) def explainexit(code):