summaryrefslogtreecommitdiff
path: root/python/types.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2026-02-26 13:43:51 -0500
committerGlenn Smith <glenn@vector35.com>2026-02-26 13:47:49 -0500
commit5999964098498384717717737078276067473007 (patch)
treef82839f0f2ea2974b89e7434e417a1b5e3770f1a /python/types.py
parent1893495114355955459518559551893143577868 (diff)
Fix QualifiedName join from ffi and also support NameSpace join
Diffstat (limited to 'python/types.py')
-rw-r--r--python/types.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/python/types.py b/python/types.py
index 9fa20cf6..c149c70a 100644
--- a/python/types.py
+++ b/python/types.py
@@ -164,7 +164,7 @@ class QualifiedName:
name_list[i] = self.name[i].encode("utf-8")
result.name = name_list
result.nameCount = len(self.name)
- result.join = self.join.encode("utf-8")
+ result.join = self.join
return result
@staticmethod
@@ -172,7 +172,7 @@ class QualifiedName:
result = []
for i in range(0, name.nameCount):
result.append(name.name[i].decode("utf-8"))
- return QualifiedName(result, name.join.decode("utf-8"))
+ return QualifiedName(result, name.join)
@property
def name(self) -> List[str]:
@@ -216,16 +216,14 @@ class TypeReferenceSource:
class NameSpace(QualifiedName):
- def __str__(self):
- return ":".join(self.name)
-
def _to_core_struct(self) -> core.BNNameSpace:
result = core.BNNameSpace()
name_list = (ctypes.c_char_p * len(self.name))()
for i in range(0, len(self.name)):
- name_list[i] = self.name[i].encode('charmap')
+ name_list[i] = self.name[i].encode('utf-8')
result.name = name_list
result.nameCount = len(self.name)
+ result.join = self.join
return result
@staticmethod
@@ -233,7 +231,7 @@ class NameSpace(QualifiedName):
result = []
for i in range(0, name.nameCount):
result.append(name.name[i].decode("utf-8"))
- return NameSpace(result)
+ return NameSpace(result, name.join)
@staticmethod
def get_core_struct(name: Optional[Union[str, List[str], 'NameSpace']]) -> Optional[core.BNNameSpace]: