Skip to content

Commit 5dd9af2

Browse files
committed
Move DOS device constants into try: block
1 parent 4bb81ee commit 5dd9af2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/test/support/os_helper.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -722,15 +722,15 @@ def __exit__(self, *ignore_exc):
722722
try:
723723
import ctypes
724724
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
725-
except (ImportError, AttributeError):
726-
def subst_drive(path):
727-
raise unittest.SkipTest('ctypes or kernel32 is not available')
728-
else:
725+
729726
ERROR_FILE_NOT_FOUND = 2
730727
DDD_REMOVE_DEFINITION = 2
731728
DDD_EXACT_MATCH_ON_REMOVE = 4
732729
DDD_NO_BROADCAST_SYSTEM = 8
733-
730+
except (ImportError, AttributeError):
731+
def subst_drive(path):
732+
raise unittest.SkipTest('ctypes or kernel32 is not available')
733+
else:
734734
@contextlib.contextmanager
735735
def subst_drive(path):
736736
"""Temporarily yield a substitute drive for a given path."""

0 commit comments

Comments
 (0)