[Lldb-commits] [PATCH] D13880: Create an lldb/third_party folder, and add Python module 'six' to it.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 19 16:10:19 PDT 2015

zturner created this revision.
zturner added reviewers: tfiala, clayborg, dberlin.
zturner added a subscriber: lldb-commits.

`six` is a Python module licensed under MIT which provides a compatibility layer between Python 2 and Python 3.  You can read about it at the project's homepage, here.  https://pypi.python.org/pypi/six

six consists of only a single python file, so it's very easy to drop into an existing project, works with any Python version >= 2.6, and is permissively licensed under MIT so should present no problem being in our repo.

The immediate need for this is that many modules and functions were either renamed or deleted in Python 3.  A few examples of this: 
Renamed modules:
   `StringIO` -> `io`
   `cPickle` -> `pickle`
   `Queue` -> `queue`

Renamed methods:
   `unichr` -> `chr`
   `u"foo"` -> `"foo"`

There are other examples as well.  If we have to these behind a runtime version check at every usage site, it's going to be ugly, error prone, and cause a maintenance burden.  With `six` this becomes very transparent and should make it easy to have consistent behavior running under both supported versions of Python.

Note that this patch does not do anything to get `six` into lldb's `site-packages` folder or hook it up to anything.  This CL is only to get approval for "yes you can add this to LLDB".  Hooking it up will come later.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13880.37812.patch
Type: text/x-patch
Size: 32421 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151019/94d52d39/attachment-0001.bin>

More information about the lldb-commits mailing list