summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-11-13 21:04:31 (GMT)
committerGuido van Rossum <guido@python.org>2002-11-13 21:04:31 (GMT)
commitaffa6b7bf16a998c0e15df60459776cf1c8339b0 (patch)
tree868c080e69d28e0d7229fb016958c2c4ad11813f
parent3f1c9a916f87cb35cbf9a164dc6e84606e97e48c (diff)
downloadcpython-affa6b7bf16a998c0e15df60459776cf1c8339b0.zip
cpython-affa6b7bf16a998c0e15df60459776cf1c8339b0.tar.gz
cpython-affa6b7bf16a998c0e15df60459776cf1c8339b0.tar.bz2
Tim wins a bet. Don't use re.
-rwxr-xr-xTools/scripts/crlf.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/scripts/crlf.py b/Tools/scripts/crlf.py
index 5818185..59e3ff3 100755
--- a/Tools/scripts/crlf.py
+++ b/Tools/scripts/crlf.py
@@ -2,7 +2,7 @@
"Replace CRLF with LF in argument files. Print names of changed files."
-import sys, re, os
+import sys, os
for file in sys.argv[1:]:
if os.path.isdir(file):
print file, "Directory!"
@@ -11,7 +11,7 @@ for file in sys.argv[1:]:
if '\0' in data:
print file, "Binary!"
continue
- newdata = re.sub("\r\n", "\n", data)
+ newdata = data.replace("\r\n", "\n")
if newdata != data:
print file
f = open(file, "wb")