diff options
| author | Lawrence D'Anna <lawrence_danna@apple.com> | 2019-10-09 21:50:46 +0000 |
|---|---|---|
| committer | Lawrence D'Anna <lawrence_danna@apple.com> | 2019-10-09 21:50:46 +0000 |
| commit | b24022cd723f47c8dd5e78ed7b210c1b6287ff42 (patch) | |
| tree | 962257b4964f3eb34e48a1040cb6540bc818ec01 /lldb/scripts/Python | |
| parent | 865cd0932f4483058ccc607b8867a4a5a597ec52 (diff) | |
| download | llvm-b24022cd723f47c8dd5e78ed7b210c1b6287ff42.zip llvm-b24022cd723f47c8dd5e78ed7b210c1b6287ff42.tar.gz llvm-b24022cd723f47c8dd5e78ed7b210c1b6287ff42.tar.bz2 | |
SBFile: add a bunch of tests that should eventually work.
Summary:
It's really annoying and confusing to have to keep referring
back to earlier versions of this SBFile work to find the
tests that need to be added for each patch, and not duplicate
them with new tests.
This patch just imports all my tests. A bunch of them don't
work yet, so they are marked to be skipped. They'll be
unmarked as I fix them.
One of these tests will actually trip an assert in the SWIG
code now instead of just failing, so I'm fixing that here too.
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: JDevlieghere, labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68433
llvm-svn: 374237
Diffstat (limited to 'lldb/scripts/Python')
| -rw-r--r-- | lldb/scripts/Python/python-typemaps.swig | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lldb/scripts/Python/python-typemaps.swig b/lldb/scripts/Python/python-typemaps.swig index f963e37..9428c7c 100644 --- a/lldb/scripts/Python/python-typemaps.swig +++ b/lldb/scripts/Python/python-typemaps.swig @@ -444,19 +444,19 @@ bool SetNumberFromPyObject<double>(double &number, PyObject *obj) { $1 = nullptr; else if (!lldb_private::PythonFile::Check($input)) { int fd = PyObject_AsFileDescriptor($input); + if (fd < 0 || PyErr_Occurred()) + return nullptr; PythonObject py_input(PyRefType::Borrowed, $input); PythonString py_mode = py_input.GetAttributeValue("mode").AsType<PythonString>(); - - if (-1 != fd && py_mode.IsValid()) { - FILE *f; - if ((f = fdopen(fd, py_mode.GetString().str().c_str()))) - $1 = f; - else - PyErr_SetString(PyExc_TypeError, strerror(errno)); - } else { - PyErr_SetString(PyExc_TypeError,"not a file-like object"); - return nullptr; - } + if (!py_mode.IsValid() || PyErr_Occurred()) + return nullptr; + FILE *f; + if ((f = fdopen(fd, py_mode.GetString().str().c_str()))) + $1 = f; + else { + PyErr_SetString(PyExc_TypeError, strerror(errno)); + return nullptr; + } } else { |
