Patchwork [1,of,5] run-tests: test for os.altsep instead of os.name when checking \ for /

login
register
mail settings
Submitter Simon Heimberg
Date July 13, 2013, 10:25 p.m.
Message ID <982668dfa95a3adf94bd.1373754311@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1881/
State Accepted
Commit e823abe577a263b7d26dead22caa1fd73c2aa88f
Headers show

Comments

Simon Heimberg - July 13, 2013, 10:25 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1373752675 -7200
# Node ID 982668dfa95a3adf94bd166e8a443e887774cd47
# Parent  c634510b16e8c57c1bc9451e0947bbd912d6fc75
run-tests: test for os.altsep instead of os.name when checking \ for /

This tells more explicitly what it is about
Matt Mackall - July 17, 2013, 7:52 p.m.
On Sun, 2013-07-14 at 00:25 +0200, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1373752675 -7200
> # Node ID 982668dfa95a3adf94bd166e8a443e887774cd47
> # Parent  c634510b16e8c57c1bc9451e0947bbd912d6fc75
> run-tests: test for os.altsep instead of os.name when checking \ for /

Queued for default, thanks.

Patch

diff -r c634510b16e8 -r 982668dfa95a tests/run-tests.py
--- a/tests/run-tests.py	Sam Jul 13 23:15:05 2013 +0200
+++ b/tests/run-tests.py	Sam Jul 13 23:57:55 2013 +0200
@@ -599,7 +599,7 @@ 
     # The only supported special characters are * and ? plus / which also
     # matches \ on windows. Escaping of these caracters is supported.
     if el + '\n' == l:
-        if os.name == 'nt':
+        if os.altsep:
             # matching on "/" is not needed for this line
             log("\nInfo, unnecessary glob: %s (glob)" % el)
         return True
@@ -615,7 +615,7 @@ 
             res += '.*'
         elif c == '?':
             res += '.'
-        elif c == '/' and os.name == 'nt':
+        elif c == '/' and os.altsep:
             res += '[/\\\\]'
         else:
             res += re.escape(c)