tests/filtertmp.py
author Renato Cunha <renatoc@gmail.com>
Tue, 15 Jun 2010 19:49:56 -0300
changeset 11361 3de3d670d2b6
parent 10469 b26c4a89a143
permissions -rwxr-xr-x
parsers.c: Added support for py3k. This patch adds support for py3k in parsers.c. This is accomplished by including a header file responsible for abstracting the API differences between python 2 and python 3.

#!/usr/bin/env python
#
# This used to be a simple sed call like:
#
#  $ sed "s:$HGTMP:*HGTMP*:"
#
# But $HGTMP has ':' under Windows which breaks the sed call.
#
import sys, os

input = sys.stdin.read()
input = input.replace(os.sep, '/')
hgtmp = os.environ['HGTMP'].replace(os.sep, '/')
input = input.replace(hgtmp, '$HGTMP')
sys.stdout.write(input)