mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 09:15:35 +00:00
5f793ef2b0
Automatic update from web-platform-tests Allow wpt.py to be called from outside the WPT directory Note that this is about wpt.py, which is a file specifically used for Windows, and not 'wpt' which is the main entry-point file. Previously wpt.py would just try to exec 'wpt' in the current working directory, which may not be the directory that contains 'wpt.py' (and thus, no 'wpt'!). To fix that, we os.chdir into the same directory as the __file__. Fixes https://github.com/web-platform-tests/wpt/issues/23095 -- wpt-commits: 07ca316106218e6c21133fed91176d8e41df1d17 wpt-pr: 23096
8 lines
321 B
Python
8 lines
321 B
Python
# This file exists to allow `python wpt <command>` to work on Windows:
|
|
# https://github.com/web-platform-tests/wpt/pull/6907 and
|
|
# https://github.com/web-platform-tests/wpt/issues/23095
|
|
import os
|
|
abspath = os.path.abspath(__file__)
|
|
os.chdir(os.path.dirname(abspath))
|
|
exec(compile(open("wpt", "r").read(), "wpt", 'exec'))
|