summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/reindent-rst.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-08-18 21:59:12 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-08-18 21:59:12 (GMT)
commitd5f2b5421a9559b61ae4a55a2d8727373336bb92 (patch)
tree2718c179ba2651271d193de27b66aa16b315422e /Tools/scripts/reindent-rst.py
parent94908bbc1503df830d1d615e7b57744ae1b41079 (diff)
downloadcpython-d5f2b5421a9559b61ae4a55a2d8727373336bb92.zip
cpython-d5f2b5421a9559b61ae4a55a2d8727373336bb92.tar.gz
cpython-d5f2b5421a9559b61ae4a55a2d8727373336bb92.tar.bz2
Fix reindent-rst.py: it works on binary files
Diffstat (limited to 'Tools/scripts/reindent-rst.py')
-rwxr-xr-xTools/scripts/reindent-rst.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/scripts/reindent-rst.py b/Tools/scripts/reindent-rst.py
index 55b99eb..a19406f 100755
--- a/Tools/scripts/reindent-rst.py
+++ b/Tools/scripts/reindent-rst.py
@@ -6,7 +6,7 @@
import sys, re, shutil
-ws_re = re.compile(r'\s+(\r?\n)$')
+ws_re = re.compile(br'\s+(\r?\n)$')
def main(argv=sys.argv):
rv = 0
@@ -14,7 +14,7 @@ def main(argv=sys.argv):
try:
with open(filename, 'rb') as f:
lines = f.readlines()
- new_lines = [ws_re.sub(r'\1', line) for line in lines]
+ new_lines = [ws_re.sub(br'\1', line) for line in lines]
if new_lines != lines:
print('Fixing %s...' % filename)
shutil.copyfile(filename, filename + '.bak')