changeset 36487:0e8b76644e20

py3: convert os.devnull to bytes using pycompat.bytestr os.devnull returns str on Python 3. Differential Revision: https://phab.mercurial-scm.org/D2477
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 27 Feb 2018 14:42:30 +0530
parents 9ff5cbfbc26a
children 2218f5bfafca
files hgext/convert/common.py mercurial/windows.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/common.py	Tue Feb 27 14:41:24 2018 +0530
+++ b/hgext/convert/common.py	Tue Feb 27 14:42:30 2018 +0530
@@ -339,7 +339,7 @@
                 pass
         cmdline = [util.shellquote(arg) for arg in cmdline]
         if not self.ui.debugflag:
-            cmdline += ['2>', os.devnull]
+            cmdline += ['2>', pycompat.bytestr(os.devnull)]
         cmdline = ' '.join(cmdline)
         return cmdline
 
--- a/mercurial/windows.py	Tue Feb 27 14:41:24 2018 +0530
+++ b/mercurial/windows.py	Tue Feb 27 14:42:30 2018 +0530
@@ -316,7 +316,7 @@
     # Work around "popen spawned process may not write to stdout
     # under windows"
     # http://bugs.python.org/issue1366
-    command += " 2> %s" % os.devnull
+    command += " 2> %s" % pycompat.bytestr(os.devnull)
     return os.popen(quotecommand(command), mode)
 
 def explainexit(code):