Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 784ca6c

Browse files
committed
path.cat --> join
1 parent 668317d commit 784ca6c

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

Lib/dircache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ def listdir(path): # List directory contents, using cache
3232

3333
def annotate(head, list): # Add '/' suffixes to directories
3434
for i in range(len(list)):
35-
if path.isdir(path.cat(head, list[i])):
35+
if path.isdir(path.join(head, list[i])):
3636
list[i] = list[i] + '/'

Lib/dircmp.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def phase2(dd): # Distinguish files, directories, funnies
5353
dd.common_funny = []
5454
#
5555
for x in dd.common:
56-
a_path = path.cat(dd.a, x)
57-
b_path = path.cat(dd.b, x)
56+
a_path = path.join(dd.a, x)
57+
b_path = path.join(dd.b, x)
5858
#
5959
ok = 1
6060
try:
@@ -92,8 +92,8 @@ def phase4(dd): # Find out differences between common subdirectories
9292
# The hide and ignore properties are inherited from the parent
9393
dd.subdirs = {}
9494
for x in dd.common_dirs:
95-
a_x = path.cat(dd.a, x)
96-
b_x = path.cat(dd.b, x)
95+
a_x = path.join(dd.a, x)
96+
b_x = path.join(dd.b, x)
9797
dd.subdirs[x] = newdd = dircmp().new(a_x, b_x)
9898
newdd.hide = dd.hide
9999
newdd.ignore = dd.ignore
@@ -151,7 +151,7 @@ def report_phase4_closure(dd): # Report and do phase 4 recursively
151151
def cmpfiles(a, b, common):
152152
res = ([], [], [])
153153
for x in common:
154-
res[cmp(path.cat(a, x), path.cat(b, x))].append(x)
154+
res[cmp(path.join(a, x), path.join(b, x))].append(x)
155155
return res
156156

157157

Lib/glob.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ def glob(pathname):
1717
result = []
1818
for dirname in list:
1919
if basename or path.isdir(dirname):
20-
name = path.cat(dirname, basename)
20+
name = path.join(dirname, basename)
2121
if path.exists(name):
2222
result.append(name)
2323
else:
2424
result = []
2525
for dirname in list:
2626
sublist = glob1(dirname, basename)
2727
for name in sublist:
28-
result.append(path.cat(dirname, name))
28+
result.append(path.join(dirname, name))
2929
return result
3030

3131
def glob1(dirname, pattern):

Lib/lib-stdwin/dirwin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
def action(w, string, i, detail):
1212
(h, v), clicks, button, mask = detail
1313
if clicks = 2:
14-
name = path.cat(w.name, string)
14+
name = path.join(w.name, string)
1515
try:
1616
w2 = anywin.open(name)
1717
w2.parent = w
1818
except posix.error, why:
1919
stdwin.message('Can\'t open ' + name + ': ' + why[1])
2020

2121
def open(name):
22-
name = path.cat(name, '')
22+
name = path.join(name, '')
2323
list = dircache.opendir(name)[:]
2424
list.sort()
2525
dircache.annotate(name, list)

Lib/shutil.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def copytree(src, dst):
5252
dot_dotdot = '.', '..'
5353
for name in names:
5454
if name not in dot_dotdot:
55-
srcname = path.cat(src, name)
56-
dstname = path.cat(dst, name)
55+
srcname = path.join(src, name)
56+
dstname = path.join(dst, name)
5757
#print 'Copying', srcname, 'to', dstname
5858
try:
5959
#if path.islink(srcname):

Lib/stdwin/dirwin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
def action(w, string, i, detail):
1212
(h, v), clicks, button, mask = detail
1313
if clicks = 2:
14-
name = path.cat(w.name, string)
14+
name = path.join(w.name, string)
1515
try:
1616
w2 = anywin.open(name)
1717
w2.parent = w
1818
except posix.error, why:
1919
stdwin.message('Can\'t open ' + name + ': ' + why[1])
2020

2121
def open(name):
22-
name = path.cat(name, '')
22+
name = path.join(name, '')
2323
list = dircache.opendir(name)[:]
2424
list.sort()
2525
dircache.annotate(name, list)

0 commit comments

Comments
 (0)