llvm-project/lldb/source/Host
Zachary Turner 9c40264fda Introduce a `PythonFile` object, and use it everywhere.
Python file handling got an overhaul in Python 3, and it affects
the way we have to interact with files.  Notably:

1) `PyFile_FromFile` no longer exists, and instead we have to use
   `PyFile_FromFd`.  This means having a way to get an fd from
   a FILE*.  For this we reuse the lldb_private::File class to
   convert between FILE*s and fds, since there are some subtleties
   regarding ownership rules when FILE*s and fds refer to the same
   file.
2) PyFile is no longer a builtin type, so there is no such thing as
   `PyFile_Check`.  Instead, files in Python 3 are just instances
   of `io.IOBase`.  So the logic for checking if something is a file
   in Python 3 is to check if it is a subclass of that module.

Additionally, some unit tests are added to verify that `PythonFile`
works as expected on Python 2 and Python 3, and
`ScriptInterpreterPython` is updated to use `PythonFile` instead of
manual calls to the various `PyFile_XXX` methods.

llvm-svn: 250444
2015-10-15 19:35:48 +00:00
..
android Revert "Fix temporary directory computation on linux (pr25147)" 2015-10-15 14:46:46 +00:00
common Introduce a `PythonFile` object, and use it everywhere. 2015-10-15 19:35:48 +00:00
freebsd [Makefiles] Align library names with CMake build 2015-07-14 20:25:19 +00:00
linux ArchSpec: fix unintentional promotion of unspecified unknowns to specified unknowns 2015-10-13 23:41:19 +00:00
macosx Re-commit the (fixed) changes from r248985 which were reverted by Pavel 2015-10-08 21:48:35 +00:00
netbsd Preliminary NetBSD support 2015-10-13 05:04:13 +00:00
posix Make uses of /dev/null portable across OSes. 2015-10-14 21:37:36 +00:00
windows Make uses of /dev/null portable across OSes. 2015-10-14 21:37:36 +00:00
CMakeLists.txt Support RHEL 7 and similar systems that use architecture-specific Python lib dirs 2015-10-12 20:12:27 +00:00
Makefile [Makefiles] Re-add OSX specific code that got lost in lldbHost consolidation 2015-07-17 21:47:35 +00:00