summaryrefslogtreecommitdiff
path: root/Tools/scripts/linktree.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 +0000
committerCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 +0000
commit6afaeb757af0dbd8508a0f2352ade61e41bec84c (patch)
treef1b31bc7138b17ff39791bbb45aa81583c3b6e46 /Tools/scripts/linktree.py
parente5d0e8431f929cad2da77b63fe1b7dc0ff21a428 (diff)
downloadcpython-git-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.gz
Convert print statements to function calls in Tools/.
Diffstat (limited to 'Tools/scripts/linktree.py')
-rwxr-xr-xTools/scripts/linktree.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Tools/scripts/linktree.py b/Tools/scripts/linktree.py
index 2b41e7d2a5..748b0424bb 100755
--- a/Tools/scripts/linktree.py
+++ b/Tools/scripts/linktree.py
@@ -18,7 +18,7 @@ debug = 0
def main():
if not 3 <= len(sys.argv) <= 4:
- print 'usage:', sys.argv[0], 'oldtree newtree [linkto]'
+ print('usage:', sys.argv[0], 'oldtree newtree [linkto]')
return 2
oldtree, newtree = sys.argv[1], sys.argv[2]
if len(sys.argv) > 3:
@@ -28,46 +28,46 @@ def main():
link = LINK
link_may_fail = 0
if not os.path.isdir(oldtree):
- print oldtree + ': not a directory'
+ print(oldtree + ': not a directory')
return 1
try:
os.mkdir(newtree, 0o777)
except os.error as msg:
- print newtree + ': cannot mkdir:', msg
+ print(newtree + ': cannot mkdir:', msg)
return 1
linkname = os.path.join(newtree, link)
try:
os.symlink(os.path.join(os.pardir, oldtree), linkname)
except os.error as msg:
if not link_may_fail:
- print linkname + ': cannot symlink:', msg
+ print(linkname + ': cannot symlink:', msg)
return 1
else:
- print linkname + ': warning: cannot symlink:', msg
+ print(linkname + ': warning: cannot symlink:', msg)
linknames(oldtree, newtree, link)
return 0
def linknames(old, new, link):
- if debug: print 'linknames', (old, new, link)
+ if debug: print('linknames', (old, new, link))
try:
names = os.listdir(old)
except os.error as msg:
- print old + ': warning: cannot listdir:', msg
+ print(old + ': warning: cannot listdir:', msg)
return
for name in names:
if name not in (os.curdir, os.pardir):
oldname = os.path.join(old, name)
linkname = os.path.join(link, name)
newname = os.path.join(new, name)
- if debug > 1: print oldname, newname, linkname
+ if debug > 1: print(oldname, newname, linkname)
if os.path.isdir(oldname) and \
not os.path.islink(oldname):
try:
os.mkdir(newname, 0o777)
ok = 1
except:
- print newname + \
- ': warning: cannot mkdir:', msg
+ print(newname + \
+ ': warning: cannot mkdir:', msg)
ok = 0
if ok:
linkname = os.path.join(os.pardir,