From 1ec790ed04c355caf1950899f88a8b0315d35d38 Mon Sep 17 00:00:00 2001 From: Durham Goode Date: Tue, 19 Jul 2022 15:51:06 -0700 Subject: [PATCH] windows: upgrade to Python 3.9 Summary: Python 3.9 has a fix (https://github.com/python/cpython/issues/79473) for a slow mimetype import. This fix saves 300ms on Python startup for Mercurial. Reviewed By: jordanwebster Differential Revision: D37890474 fbshipit-source-id: 04da3d3963ba53514b2fa71dd7f1c255740dc9c1 --- eden/scm/setup.py | 6 ++++-- eden/scm/tests/runlogtest.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eden/scm/setup.py b/eden/scm/setup.py index 0757878fa7..37d64480a6 100644 --- a/eden/scm/setup.py +++ b/eden/scm/setup.py @@ -43,8 +43,10 @@ import zipfile if sys.version_info.major == 2: raise RuntimeError("This setup.py is Python 3 only!") - -PY_VERSION = "38" +if os.name == "nt": + PY_VERSION = "39" +else: + PY_VERSION = "38" def ensureenv(): diff --git a/eden/scm/tests/runlogtest.py b/eden/scm/tests/runlogtest.py index 2a9b228ef8..5889f64724 100644 --- a/eden/scm/tests/runlogtest.py +++ b/eden/scm/tests/runlogtest.py @@ -6,6 +6,7 @@ from __future__ import absolute_import import os.path +import sys import time from edenscm.mercurial import progress, registrar @@ -30,7 +31,7 @@ command = registrar.command(cmdtable) ) def basiccommandtest(ui, exit_code, **opts): waitforfile(opts.get("waitfile")) - exit(int(exit_code)) + sys.exit(int(exit_code)) @command(