1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Review fixes

This commit is contained in:
Alexander Presnyakov
2025-07-30 00:53:01 +00:00
parent d3fafe6241
commit 4df61622cc
7 changed files with 83 additions and 50 deletions

View File

@@ -1,19 +1,14 @@
from contextlib import contextmanager
import os
from collections.abc import Generator
from contextlib import contextmanager
@contextmanager
def change_directory(new_dir):
def change_directory(new_dir: str) -> Generator[None, None, None]:
"""
Context manager for temporarily changing the current working directory.
Args:
new_dir: Directory to change to
Example:
with change_directory("/path/to/dir"):
# Code here runs with the working directory as "/path/to/dir"
# After the block, we return to the original directory
:param new_dir: Directory to change to
"""
old_dir = os.getcwd()
try: