Bug 1283340: python: fix .ycm_extra_conf.py for python 3 r=gps
authorEmilio Cobos Álvarez <me@emiliocobos.me>
Wed, 29 Jun 2016 18:15:46 -0700
changeset 303751 dd8ef51f4920c5f4370afd0aebf43d1113363fc3
parent 303750 450e5d0b3df0b8e5ab94653fca7f0275cf2f05a9
child 303752 80eb5947da076120f095ac7dd6a32670032e0134
push id30401
push usercbook@mozilla.com
push dateWed, 06 Jul 2016 09:40:34 +0000
treeherdermozilla-central@a7d6bb9e7d12 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1283340
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1283340: python: fix .ycm_extra_conf.py for python 3 r=gps 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')