Patch by Gerrit Holl:

* In crlf.py and lfcr.py: regsub -> re
This commit is contained in:
Guido van Rossum 2000-02-14 21:42:14 +00:00
parent d962878309
commit 967e509a81
2 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
"Replace CRLF with LF in argument files. Print names of changed files." "Replace CRLF with LF in argument files. Print names of changed files."
import sys, regsub, os import sys, re, os
for file in sys.argv[1:]: for file in sys.argv[1:]:
if os.path.isdir(file): if os.path.isdir(file):
print file, "Directory!" print file, "Directory!"
@ -11,7 +11,7 @@ for file in sys.argv[1:]:
if '\0' in data: if '\0' in data:
print file, "Binary!" print file, "Binary!"
continue continue
newdata = regsub.gsub("\r\n", "\n", data) newdata = re.sub("\r\n", "\n", data)
if newdata != data: if newdata != data:
print file print file
f = open(file, "wb") f = open(file, "wb")

View File

@ -2,7 +2,7 @@
"Replace LF with CRLF in argument files. Print names of changed files." "Replace LF with CRLF in argument files. Print names of changed files."
import sys, regsub, os import sys, re, os
for file in sys.argv[1:]: for file in sys.argv[1:]:
if os.path.isdir(file): if os.path.isdir(file):
print file, "Directory!" print file, "Directory!"
@ -11,7 +11,7 @@ for file in sys.argv[1:]:
if '\0' in data: if '\0' in data:
print file, "Binary!" print file, "Binary!"
continue continue
newdata = regsub.gsub("\r?\n", "\r\n", data) newdata = re.sub("\r?\n", "\r\n", data)
if newdata != data: if newdata != data:
print file print file
f = open(file, "wb") f = open(file, "wb")