subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From troycurti...@apache.org
Subject svn commit: r1822739 - /subversion/branches/swig-py3/build/generator/swig/__init__.py
Date Wed, 31 Jan 2018 05:14:00 GMT
Author: troycurtisjr
Date: Wed Jan 31 05:13:59 2018
New Revision: 1822739

URL: http://svn.apache.org/viewvc?rev=1822739&view=rev
Log:
On branch swig-py3: Ensure swig check_output() is decoded as utf8.

To support Python 2 and 3, explicitly decode check_output() return as utf8.

* build/generator/swig/__init__.py
  (Generator.__init__, Generator.version): Explicitly decode check_output() as
   utf8.

Modified:
    subversion/branches/swig-py3/build/generator/swig/__init__.py

Modified: subversion/branches/swig-py3/build/generator/swig/__init__.py
URL: http://svn.apache.org/viewvc/subversion/branches/swig-py3/build/generator/swig/__init__.py?rev=1822739&r1=1822738&r2=1822739&view=diff
==============================================================================
--- subversion/branches/swig-py3/build/generator/swig/__init__.py (original)
+++ subversion/branches/swig-py3/build/generator/swig/__init__.py Wed Jan 31 05:13:59 2018
@@ -62,7 +62,7 @@ class Generator:
     if os.access(self.swig_path, os.X_OK):
       # ### TODO: What's the reason for this os.access() check?  It was added
       # ### in r873265 (== r33191).
-      self.swig_libdir = subprocess.check_output([self.swig_path, "-swiglib"]).strip()
+      self.swig_libdir = subprocess.check_output([self.swig_path, "-swiglib"]).decode('utf8').strip()
     else:
       self.swig_libdir = None
 
@@ -71,7 +71,7 @@ class Generator:
     """Get the version number of SWIG"""
 
     if not self._swigVersion:
-      swig_version = subprocess.check_output([self.swig_path, "-version"])
+      swig_version = subprocess.check_output([self.swig_path, "-version"]).decode('utf8')
       m = re.search("Version (\d+).(\d+).(\d+)", swig_version)
       if m:
         self._swigVersion = tuple(map(int, m.groups()))



Mime
View raw message