[PATCH] run-tests: better check for python version

Simon Heimberg simohe at besonet.ch
Tue Jan 7 15:49:34 CST 2014


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1385413246 -3600
#      Mon Nov 25 22:00:46 2013 +0100
# Node ID 84758e649f83d8270db274e67bdf80b981510f7c
# Parent  7c3b86a296f16433688788376c2bd87991b4ba00
run-tests: better check for python version

Compare version by using pythons tuple comparison. So we do not match on python
3.0 or newer.

diff -r 7c3b86a296f1 -r 84758e649f83 tests/run-tests.py
--- a/tests/run-tests.py	Sun Nov 17 20:15:28 2013 +0100
+++ b/tests/run-tests.py	Mon Nov 25 22:00:46 2013 +0100
@@ -63,7 +63,7 @@
 # subprocess._cleanup can race with any Popen.wait or Popen.poll on py24
 # http://bugs.python.org/issue1731717 for details. We shouldn't be producing
 # zombies but it's pretty harmless even if we do.
-if sys.version_info[1] < 5:
+if sys.version_info < (2, 5):
     subprocess._cleanup = lambda: None
 
 closefds = os.name == 'posix'


More information about the Mercurial-devel mailing list