File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 66import contextlib
77import dataclasses
88import functools
9- import getpass
109import _opcode
1110import os
1211import re
@@ -383,6 +382,7 @@ def wrapper(*args, **kw):
383382
384383def skip_if_buildbot (reason = None ):
385384 """Decorator raising SkipTest if running on a buildbot."""
385+ import getpass
386386 if not reason :
387387 reason = 'not suitable for buildbots'
388388 try :
Original file line number Diff line number Diff line change 1010import unittest
1111import warnings
1212
13+ from test import support
14+
1315
1416# Filename used for testing
1517TESTFN_ASCII = '@test'
@@ -720,13 +722,16 @@ def __exit__(self, *ignore_exc):
720722
721723
722724try :
723- import ctypes
724- kernel32 = ctypes .WinDLL ('kernel32' , use_last_error = True )
725-
726- ERROR_FILE_NOT_FOUND = 2
727- DDD_REMOVE_DEFINITION = 2
728- DDD_EXACT_MATCH_ON_REMOVE = 4
729- DDD_NO_BROADCAST_SYSTEM = 8
725+ if support .MS_WINDOWS :
726+ import ctypes
727+ kernel32 = ctypes .WinDLL ('kernel32' , use_last_error = True )
728+
729+ ERROR_FILE_NOT_FOUND = 2
730+ DDD_REMOVE_DEFINITION = 2
731+ DDD_EXACT_MATCH_ON_REMOVE = 4
732+ DDD_NO_BROADCAST_SYSTEM = 8
733+ else :
734+ raise AttributeError
730735except (ImportError , AttributeError ):
731736 def subst_drive (path ):
732737 raise unittest .SkipTest ('ctypes or kernel32 is not available' )
You can’t perform that action at this time.
0 commit comments