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 303771 dd8ef51f4920c5f4370afd0aebf43d1113363fc3
parent 303770 450e5d0b3df0b8e5ab94653fca7f0275cf2f05a9
child 303772 80eb5947da076120f095ac7dd6a32670032e0134
push id19889
push usergszorc@mozilla.com
push dateThu, 07 Jul 2016 01:45:25 +0000
treeherderfx-team@091b06284ffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
Bug 1283340: python: fix .ycm_extra_conf.py for python 3 r=gps MozReview-Commit-ID: 2HTAftYwZPJ
--- 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
+    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')