Patchwork run-tests: better check for python version

login
register
mail settings
Submitter Simon Heimberg
Date Jan. 7, 2014, 9:49 p.m.
Message ID <84758e649f83d8270db2.1389131374@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/3277/
State Accepted
Commit f694cd81b600b65d23dcdc7a02cfd6a57dd1d018
Headers show

Comments

Simon Heimberg - Jan. 7, 2014, 9:49 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@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.
Matt Mackall - Jan. 7, 2014, 10:06 p.m.
On Tue, 2014-01-07 at 22:49 +0100, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@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

Sure, queued for default.

Patch

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'