[PATCH] D52173: Python bindings TypeError in reparse method

2018-10-10 Thread Sylvestre Ledru via Phabricator via cfe-commits
sylvestre.ledru added a comment.
Herald added a subscriber: arphaman.

I am sorry but I am not the right reviewer for that. Sorry!


Repository:
  rC Clang

https://reviews.llvm.org/D52173



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D52173: Python bindings TypeError in reparse method

2018-09-19 Thread Axel Tillequin via Phabricator via cfe-commits
bdcht edited reviewers, added: sylvestre.ledru; removed: clang.
bdcht added a comment.

changed reviewers.


Repository:
  rC Clang

https://reviews.llvm.org/D52173



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D52173: Python bindings TypeError in reparse method

2018-09-17 Thread Axel Tillequin via Phabricator via cfe-commits
bdcht created this revision.
bdcht added a reviewer: clang.
bdcht added a project: clang.
Herald added a subscriber: cfe-commits.

In method 'reparse' of the python bindings (cindex.py), a TypeError is raised 
when 'unsaved_files_array' is set from name/value arguments when using Python3.
(This is due to Python3 mess with bytes vs unicode str...)
The way this unsaved_files_array is set here is not consistent with similar 
code in other methods like 'from_source' or 'codeComplete'. This proposed fix 
just
replicates what is done in from_source/codeComplete to set this ctypes 
unsaved_files_array.


Repository:
  rC Clang

https://reviews.llvm.org/D52173

Files:
  bindings/python/clang/cindex.py


Index: bindings/python/clang/cindex.py
===
--- bindings/python/clang/cindex.py
+++ bindings/python/clang/cindex.py
@@ -2983,8 +2983,8 @@
 print(value)
 if not isinstance(value, str):
 raise TypeError('Unexpected unsaved file contents.')
-unsaved_files_array[i].name = name
-unsaved_files_array[i].contents = value
+unsaved_files_array[i].name = b(name)
+unsaved_files_array[i].contents = b(value)
 unsaved_files_array[i].length = len(value)
 ptr = conf.lib.clang_reparseTranslationUnit(self, len(unsaved_files),
 unsaved_files_array, options)


Index: bindings/python/clang/cindex.py
===
--- bindings/python/clang/cindex.py
+++ bindings/python/clang/cindex.py
@@ -2983,8 +2983,8 @@
 print(value)
 if not isinstance(value, str):
 raise TypeError('Unexpected unsaved file contents.')
-unsaved_files_array[i].name = name
-unsaved_files_array[i].contents = value
+unsaved_files_array[i].name = b(name)
+unsaved_files_array[i].contents = b(value)
 unsaved_files_array[i].length = len(value)
 ptr = conf.lib.clang_reparseTranslationUnit(self, len(unsaved_files),
 unsaved_files_array, options)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits