
We recently added an explicit finalize to SBProgress, #128966. I realized while adding some additional implementations of SBProgress that we should to add `with` support for ease of use. This patch addresses adding and `__enter()__` method (which a no-op) and an `__exit()__` to swig. I also refactor the emitter for the test to leverage `with` instead of explicitly calling finalize, and I've updated the docstrings.
13 lines
304 B
OpenEdge ABL
13 lines
304 B
OpenEdge ABL
%extend lldb::SBProgress {
|
|
#ifdef SWIGPYTHON
|
|
%pythoncode %{
|
|
def __enter__(self):
|
|
'''No-op for with statement'''
|
|
pass
|
|
|
|
def __exit__(self, exc_type, exc_value, traceback):
|
|
'''Finalize the progress object'''
|
|
self.Finalize()
|
|
%}
|
|
#endif
|
|
} |