summaryrefslogtreecommitdiff
path: root/lldb/bindings
diff options
context:
space:
mode:
authorDave Lee <davelee.com@gmail.com>2022-11-21 12:31:24 -0800
committerDave Lee <davelee.com@gmail.com>2022-11-21 12:31:43 -0800
commitba87147881c8f6592aea0cbdb22d0028e78b30d8 (patch)
tree49222761d8bcd1917ac3a8cba266c5955a21bff4 /lldb/bindings
parenta365f293dcab9d408b630a525cd6cab0d48df84f (diff)
downloadllvm-ba87147881c8f6592aea0cbdb22d0028e78b30d8.tar.gz
Revert "[lldb] Fix SBFileSpec.fullpath"
This reverts commit a59ed8fa86036efe66efcaddd5cd3e1d17856563.
Diffstat (limited to 'lldb/bindings')
-rw-r--r--lldb/bindings/interface/SBFileSpec.i13
1 files changed, 12 insertions, 1 deletions
diff --git a/lldb/bindings/interface/SBFileSpec.i b/lldb/bindings/interface/SBFileSpec.i
index e6f9bb81e240..b549321487ec 100644
--- a/lldb/bindings/interface/SBFileSpec.i
+++ b/lldb/bindings/interface/SBFileSpec.i
@@ -84,7 +84,18 @@ public:
#ifdef SWIGPYTHON
%pythoncode %{
- fullpath = property(str, None, doc='''A read only property that returns the fullpath as a python string.''')
+ def __get_fullpath__(self):
+ spec_dir = self.GetDirectory()
+ spec_file = self.GetFilename()
+ if spec_dir and spec_file:
+ return '%s/%s' % (spec_dir, spec_file)
+ elif spec_dir:
+ return spec_dir
+ elif spec_file:
+ return spec_file
+ return None
+
+ fullpath = property(__get_fullpath__, None, doc='''A read only property that returns the fullpath as a python string.''')
basename = property(GetFilename, None, doc='''A read only property that returns the path basename as a python string.''')
dirname = property(GetDirectory, None, doc='''A read only property that returns the path directory name as a python string.''')
exists = property(Exists, None, doc='''A read only property that returns a boolean value that indicates if the file exists.''')