summaryrefslogtreecommitdiff
path: root/numpy/distutils/line_endings.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-06 13:25:26 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-04-06 13:25:26 -0600
commitbb726ca19f434f5055c0efceefe48d89469fcbbe (patch)
tree889782afaf67fd5acb5f222969251871c0c46e5a /numpy/distutils/line_endings.py
parent7441fa50523f5b4a16c854bf004d675e5bd86ab8 (diff)
downloadnumpy-bb726ca19f434f5055c0efceefe48d89469fcbbe.tar.gz
2to3: Apply `print` fixer.
Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
Diffstat (limited to 'numpy/distutils/line_endings.py')
-rw-r--r--numpy/distutils/line_endings.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/numpy/distutils/line_endings.py b/numpy/distutils/line_endings.py
index 93f5421c0..fe1efdca6 100644
--- a/numpy/distutils/line_endings.py
+++ b/numpy/distutils/line_endings.py
@@ -1,30 +1,30 @@
""" Functions for converting from DOS to UNIX line endings
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
import sys, re, os
def dos2unix(file):
"Replace CRLF with LF in argument files. Print names of changed files."
if os.path.isdir(file):
- print file, "Directory!"
+ print(file, "Directory!")
return
data = open(file, "rb").read()
if '\0' in data:
- print file, "Binary!"
+ print(file, "Binary!")
return
newdata = re.sub("\r\n", "\n", data)
if newdata != data:
- print 'dos2unix:', file
+ print('dos2unix:', file)
f = open(file, "wb")
f.write(newdata)
f.close()
return file
else:
- print file, 'ok'
+ print(file, 'ok')
def dos2unix_one_dir(modified_files,dir_name,file_names):
for file in file_names:
@@ -42,23 +42,23 @@ def dos2unix_dir(dir_name):
def unix2dos(file):
"Replace LF with CRLF in argument files. Print names of changed files."
if os.path.isdir(file):
- print file, "Directory!"
+ print(file, "Directory!")
return
data = open(file, "rb").read()
if '\0' in data:
- print file, "Binary!"
+ print(file, "Binary!")
return
newdata = re.sub("\r\n", "\n", data)
newdata = re.sub("\n", "\r\n", newdata)
if newdata != data:
- print 'unix2dos:', file
+ print('unix2dos:', file)
f = open(file, "wb")
f.write(newdata)
f.close()
return file
else:
- print file, 'ok'
+ print(file, 'ok')
def unix2dos_one_dir(modified_files,dir_name,file_names):
for file in file_names: