don't try installing win32api on Python 3.4
Markus Gerstel
5 years ago
8 | 8 |
by default. This causes procrunner to call the Win32 API FindExecutable()
|
9 | 9 |
function to try and lookup non-.exe files with the corresponding name. This
|
10 | 10 |
means .bat/.cmd/etc.. files can now be run without explicitly specifying
|
11 | |
their extension.
|
|
11 |
their extension. Only supported on Python 2.7 and 3.5+.
|
12 | 12 |
|
13 | 13 |
0.4.0 (2018-04-23)
|
14 | 14 |
------------------
|
268 | 268 |
if win32resolve and sys.platform == 'win32':
|
269 | 269 |
try:
|
270 | 270 |
import win32api
|
271 | |
_, found_executable = win32api.FindExecutable(command[0])
|
272 | |
logger.debug("Resolved %s as %s", command[0], found_executable)
|
273 | |
command[0] = found_executable
|
274 | 271 |
except ImportError:
|
275 | |
logger.warn("Could not resolve executable name: package win32api missing")
|
|
272 |
win32api = None
|
|
273 |
if (2, 8) < sys.version_info < (3, 5):
|
|
274 |
logger.info("Resolving executable names only supported on Python 2.7 and 3.5+")
|
|
275 |
else:
|
|
276 |
logger.warn("Could not resolve executable name: package win32api missing")
|
|
277 |
try:
|
|
278 |
if win32api:
|
|
279 |
_, found_executable = win32api.FindExecutable(command[0])
|
|
280 |
logger.debug("Resolved %s as %s", command[0], found_executable)
|
|
281 |
command[0] = found_executable
|
276 | 282 |
except Exception as e:
|
277 | 283 |
if not hasattr(e, 'winerror'): raise
|
278 | 284 |
logger.warn("Error trying to resolve the executable: %s", getattr(e, 'strerror', str(e)))
|
10 | 10 |
history = history_file.read()
|
11 | 11 |
|
12 | 12 |
requirements = ['six']
|
13 | |
if sys.platform == 'win32':
|
|
13 |
if sys.platform == 'win32' and not ((2, 8) < sys.version_info < (3, 5)):
|
|
14 |
# PyWin32 is only supported on 2.7 and 3.5+
|
14 | 15 |
requirements.append('pywin32')
|
15 | 16 |
|
16 | 17 |
setup_requirements = ['pytest-runner', 'six']
|