Bug 1283340: python: fix .ycm_extra_conf.py for python 3 draft
authorEmilio Cobos Álvarez <me@emiliocobos.me>
Wed, 29 Jun 2016 18:15:46 -0700
changeset 382612 98be2bb7d80d42cff7a2177ba897b7f5d8a6852a
parent 382491 e1067086c238f1aa17e6f42c74766e946bc95643
child 524254 267e32a106e2747cacbda359edee1f3922936f49
push id21786
push userbmo:ealvarez@mozilla.com
push dateThu, 30 Jun 2016 01:23:37 +0000
bugs1283340
milestone50.0a1
Bug 1283340: python: fix .ycm_extra_conf.py for python 3 MozReview-Commit-ID: 2HTAftYwZPJ
.ycm_extra_conf.py
--- a/.ycm_extra_conf.py
+++ b/.ycm_extra_conf.py
@@ -1,17 +1,20 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import imp
 import os
-from StringIO import StringIO
 import shlex
 import sys
+try:
+    from StringIO import StringIO
+except ImportError:
+    from io import StringIO
 
 old_bytecode = sys.dont_write_bytecode
 sys.dont_write_bytecode = True
 
 path = os.path.join(os.path.dirname(__file__), 'mach')
 
 if not os.path.exists(path):
     path = os.path.join(os.path.dirname(__file__), 'config.status')