From 4a97547c3d9508a8181345881d06dcf6a72c1726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 8 Aug 2016 21:00:20 -0700 Subject: [PATCH] Bug 1293534: Fix .ycm_extra_conf after bug 1195748. r=gps MozReview-Commit-ID: HwNnOUThxev --- .ycm_extra_conf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py index bd7b29bf0099..4539ae535a6f 100644 --- a/.ycm_extra_conf.py +++ b/.ycm_extra_conf.py @@ -27,6 +27,10 @@ def FlagsForFile(filename): mach = mach_module.get_mach() out = StringIO() + + # Mach calls sys.stdout.fileno(), so we need to fake it when capturing it. + # Returning an invalid file descriptor does the trick. + out.fileno = lambda: -1 out.encoding = None mach.run(['compileflags', filename], stdout=out, stderr=out)