#!/usr/bin/env python
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""Wrapper around
   third_party/WebKit/WebKitTools/Scripts/new-run-webkit-tests"""
import os
import subprocess
import sys

def main():
    cmd = [sys.executable]
    src_dir = sys.argv[0];
    if sys.platform != 'cygwin':
        src_dir = os.path.abspath(sys.argv[0])
    print src_dir
    src_dir=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(
                         os.path.dirname(src_dir)))))
    script_dir=os.path.join(src_dir, "third_party", "WebKit", "WebKitTools",
                            "Scripts")
    script = os.path.join(script_dir, 'new-run-webkit-tests')
    cmd.append(script)
    if '--chromium' not in sys.argv:
        cmd.append('--chromium')
    cmd.extend(sys.argv[1:])
    return subprocess.call(cmd)

if __name__ == '__main__':
    sys.exit(main())


@@ -363,131 +363,24 @@
 r = 
-sys.argv%5B0%5D;%0A    if sys.platform != 'cygwin':%0A        src_dir = os.path.abspath(sys.argv%5B0%5D)%0A    print src_dir%0A    src_dir=
+os.path.abspath(
 os.p
@@ -392,108 +392,37 @@
 oin(
-o
+sy
 s.path
-.dirname(os.path.dirname(os.path.dirname(%0A                         os.path.dirname(src_dir)))
+%5B0%5D, '..', '..', '..'
 ))%0A 

Fix python run_webkit_tests wrapper script to work correctly regardless of whether you're running cygwin python or win32 python and regardless of where you're invoking the script from.