Skip to content

Commit 35439da

Browse files
authored
Include psutil module in the python build to enable emrun to track when browser process finishes. (#1464)
Without this, emrun web server will be left running after user code quits the page abnormally without calling `exit()` (e.g. due to a page awwsnap crash), and there are multiple processes in use by the browser. emrun has a graceful fallback to weaker browser process detection when psutil is not available, so this is easy to miss if not running emrun with --verbose: https://github.com/emscripten-core/emscripten/blob/814ec05f74eac9025c0442f51fa09bd8d02f8b43/emrun.py#L330-L339
1 parent 2c42698 commit 35439da

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/update_python.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,17 @@ def build_python():
148148

149149
install_dir = os.path.join(src_dir, 'install')
150150

151-
# Install requests module. This is needed in particualr on macOS to ensure
151+
# Install requests module. This is needed in particular on macOS to ensure
152152
# SSL certificates are available (certifi in installed and used by requests).
153153
pybin = os.path.join(src_dir, 'install', 'usr', 'local', 'bin', 'python3')
154154
pip = os.path.join(src_dir, 'install', 'usr', 'local', 'bin', 'pip3')
155155
check_call([pybin, '-m', 'ensurepip', '--upgrade'])
156156
check_call([pybin, pip, 'install', 'requests'])
157157

158+
# Install psutil module. This is needed by emrun to track when browser
159+
# process quits.
160+
check_call([pybin, pip, 'install', 'psutil'])
161+
158162
dirname = 'python-%s-%s' % (version, revision)
159163
if os.path.isdir(dirname):
160164
print('Erasing old build directory ' + dirname)

0 commit comments

Comments
 (0)