From 32ac147b00e4ffd9f5baddcfabc0fd84a12e9f86 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Mon, 16 Nov 2015 22:40:12 +0000 Subject: Python3 - Fix some issues related to `PythonFile` class. Python 3 has lots of new debug asserts, and some of these were firing on PythonFile. Specifically related to handling of invalid files. llvm-svn: 253261 --- lldb/scripts/Python/python-typemaps.swig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lldb/scripts/Python') diff --git a/lldb/scripts/Python/python-typemaps.swig b/lldb/scripts/Python/python-typemaps.swig index ad8569a7cd9..9921c485162 100644 --- a/lldb/scripts/Python/python-typemaps.swig +++ b/lldb/scripts/Python/python-typemaps.swig @@ -552,6 +552,11 @@ File file($1, false); PythonFile py_file(file, mode); $result = py_file.release(); + if (!$result) + { + $result = Py_None; + Py_INCREF(Py_None); + } } %typemap(in) (const char* string, int len) { -- cgit v1.2.3