teak-llvm/lldb/scripts/Python
Zachary Turner c22811bbcc Python 3 - Use __bool__() instead of __nonzero__() for truthiness.
Python has a complicated mechanism of checking an objects truthity.
This involves a number of steps, which end with calling two private
methods on an object (if they are implemented).  In Python 2 these
two methods are `__nonzero__` and `__len__`, and in Python 3 they
are `__bool__` and `__len__`.  Because we *also* define a __len__
method for certain iterable types, this was triggering a situation
in Python 3 where `__nonzero__` wasn't defined, so it was calling
`__len__`, which was returning 0 (for example an SBDebugger with
no targets), and as a result the truthosity was determined to be
False.

We fix this by correctly using ` __bool__` for Python 3, and leave
the behavior under Python 2 unchanged.

Note that this fix is only implemented in the SWIG generation
python script, and not the SWIG generation shell script.  Someone
more familiar than me with shell scripts will need to fix them
to support this for Python 3 if desired.

llvm-svn: 252382
2015-11-07 01:08:25 +00:00
..
android android: add a command script to help display mixed Java/native backtraces. 2014-09-23 16:28:01 +00:00
modules Python: follow python guidelines for header usage 2015-10-19 01:16:17 +00:00
build-swig-Python.sh Add language option in -gdb-show command (MI) 2015-04-28 12:51:16 +00:00
buildSwigPython.py [swig] Remove check_lldb_swig_executable_file_exists. 2015-11-06 18:53:29 +00:00
finish-swig-Python-LLDB.sh Rename argdumper to lldb-argdumper 2015-10-29 05:07:12 +00:00
finishSwigPythonLLDB.py [swig] Start of pylint on python build scripts. 2015-11-05 23:57:33 +00:00
Makefile Suppress python readline module under Linux to fix a seg fault. 2014-02-26 07:39:20 +00:00
modify-python-lldb.py Python 3 - Use __bool__() instead of __nonzero__() for truthiness. 2015-11-07 01:08:25 +00:00
python-extensions.swig Change swig interface files to use PythonDataObjects. 2015-10-14 16:59:32 +00:00
python-swigsafecast.swig Enable Python summaries to use custom SBTypeSummaryOptions if the user is so inclined. Updates to the webdoc will follow 2014-11-22 00:02:47 +00:00
python-typemaps.swig Convert SWIG typemap string operations to PythonObjects. 2015-10-16 17:51:49 +00:00
python-wrapper.swig [SBValue] Add a method GetNumChildren(uint32_t max) 2015-10-21 19:28:08 +00:00
remote-build.py Added remote-build.py and wired it into Xcode for Linux and MacOSX+Linux builds. 2015-02-03 01:50:39 +00:00
use_lldb_suite.py Python 3 - Use __bool__() instead of __nonzero__() for truthiness. 2015-11-07 01:08:25 +00:00