summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/use_lldb_suite.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix ResourceWarning about unclosed file in use_lldb_suite_root.py.Zachary Turner2016-01-151-3/+6
| | | | llvm-svn: 257945
* Remove `lldb.root` and just look for the file we care about.Zachary Turner2015-11-201-1/+1
| | | | llvm-svn: 253679
* Python 3 - Use __bool__() instead of __nonzero__() for truthiness.Zachary Turner2015-11-071-0/+22
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
OpenPOWER on IntegriCloud