mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Partial introduction of bools where appropriate.
This commit is contained in:
parent
b8bff3f4a9
commit
8ca162f417
18 changed files with 96 additions and 94 deletions
|
@ -158,7 +158,7 @@ def islink(path):
|
|||
try:
|
||||
st = os.lstat(path)
|
||||
except (os.error, AttributeError):
|
||||
return 0
|
||||
return False
|
||||
return stat.S_ISLNK(st[stat.ST_MODE])
|
||||
|
||||
|
||||
|
@ -183,7 +183,7 @@ def isdir(path):
|
|||
try:
|
||||
st = os.stat(path)
|
||||
except os.error:
|
||||
return 0
|
||||
return False
|
||||
return stat.S_ISDIR(st[stat.ST_MODE])
|
||||
|
||||
|
||||
|
@ -196,7 +196,7 @@ def isfile(path):
|
|||
try:
|
||||
st = os.stat(path)
|
||||
except os.error:
|
||||
return 0
|
||||
return False
|
||||
return stat.S_ISREG(st[stat.ST_MODE])
|
||||
|
||||
|
||||
|
@ -335,7 +335,7 @@ def expandvars(path):
|
|||
import re
|
||||
_varprog = re.compile(r'\$(\w+|\{[^}]*\})')
|
||||
i = 0
|
||||
while 1:
|
||||
while True:
|
||||
m = _varprog.search(path, i)
|
||||
if not m:
|
||||
break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue