File tree 1 file changed +18
-6
lines changed 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 82
82
# in windows we use the pygame package to get the SDL dlls
83
83
# we must get the path here because the inner pygame module will hide the real
84
84
if sys .platform == 'win32' :
85
- import imp
86
- try :
87
- dummy , sdl_lib_path , dummy = imp .find_module ('pygame' )
88
- del dummy
89
- except ImportError :
90
- sdl_lib_path = None
85
+ # module imp is deprecated in 3.5, the 3.x functionality
86
+ # needed appears in 3.4
87
+ major , minor = sys .version_info [0 :2 ]
88
+ if major == 2 or major == 3 and minor < 4 :
89
+ import imp
90
+ try :
91
+ dummy , sdl_lib_path , dummy = imp .find_module ('pygame' )
92
+ del dummy
93
+ except ImportError :
94
+ sdl_lib_path = None
95
+ else :
96
+ import importlib
97
+ try :
98
+ spec = importlib .util .find_spec ("pygame" )
99
+ sdl_lib_path = spec .submodule_search_locations [0 ]
100
+ except Exception :
101
+ sdl_lib_path = None
102
+
91
103
92
104
if not unittesting :
93
105
You can’t perform that action at this time.
0 commit comments