File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -49,13 +49,15 @@ def main() -> None:
49
49
subdir_paths = [os .path .join (typeshed_location , d ) for d in TYPESHED_SUBDIRS ]
50
50
check_subdirs_discoverable (subdir_paths )
51
51
old_typeshed_home = os .environ .get (TYPESHED_HOME )
52
- os .environ [TYPESHED_HOME ] = typeshed_location
53
- files_to_test = determine_files_to_test (paths = args .files or subdir_paths )
54
- run_all_tests (files_to_test = files_to_test , print_stderr = args .print_stderr , dry_run = args .dry_run )
55
- if old_typeshed_home is None :
56
- del os .environ [TYPESHED_HOME ]
57
- else :
58
- os .environ [TYPESHED_HOME ] = old_typeshed_home
52
+ try :
53
+ os .environ [TYPESHED_HOME ] = typeshed_location
54
+ files_to_test = determine_files_to_test (paths = args .files or subdir_paths )
55
+ run_all_tests (files_to_test = files_to_test , print_stderr = args .print_stderr , dry_run = args .dry_run )
56
+ finally :
57
+ if old_typeshed_home is None :
58
+ del os .environ [TYPESHED_HOME ]
59
+ else :
60
+ os .environ [TYPESHED_HOME ] = old_typeshed_home
59
61
60
62
61
63
def create_parser () -> argparse .ArgumentParser :
You can’t perform that action at this time.
0 commit comments