mirror of
				https://github.com/Garmelon/PFERD.git
				synced 2025-10-31 12:52:43 +01:00 
			
		
		
		
	Only remove a progress task when we added it
This commit is contained in:
		| @@ -103,7 +103,9 @@ class ProgressContextManager: | |||||||
|             traceback: Optional[TracebackType], |             traceback: Optional[TracebackType], | ||||||
|     ) -> Optional[bool]: |     ) -> Optional[bool]: | ||||||
|         """Context manager exit function. Removes the task.""" |         """Context manager exit function. Removes the task.""" | ||||||
|         if self._task_id is not None: |         if self._task_id is None: | ||||||
|  |             return None | ||||||
|  |  | ||||||
|         _progress.remove_task(self._task_id) |         _progress.remove_task(self._task_id) | ||||||
|  |  | ||||||
|         if len(_progress.task_ids) == 0: |         if len(_progress.task_ids) == 0: | ||||||
| @@ -112,7 +114,6 @@ class ProgressContextManager: | |||||||
|             _progress.refresh() |             _progress.refresh() | ||||||
|  |  | ||||||
|             # And we existed, so remove the line above (remove_task leaves one behind) |             # And we existed, so remove the line above (remove_task leaves one behind) | ||||||
|             if self._task_id is not None: |  | ||||||
|             Console().print(_OneLineUp()) |             Console().print(_OneLineUp()) | ||||||
|  |  | ||||||
|         return None |         return None | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 I-Al-Istannen
					I-Al-Istannen