progressmonitor/__init__.py
def subtask(self, units: int):
        """Create a submonitor with the given units"""
        sm = self.submonitor(units)
        try:
            yield sm
        finally:
            if sm.total is None:
                # begin was never called, so the subtask cannot be closed
                self.update(units)
            else:
                sm.done()
def subtask(self, units: int):
        """Create a submonitor with the given units"""
        sm = self.submonitor(units)
        try:
            yield sm
        finally:
            if sm.total is None:
                # begin was never called, so the subtask cannot be closed
                self.update(units)
            else:
                sm.done()
Create a submonitor with the given units