mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Convert a pile of obvious "yes/no" functions to return bool.
This commit is contained in:
parent
2f486b7fa6
commit
bc0e910826
34 changed files with 117 additions and 122 deletions
|
|
@ -375,16 +375,16 @@ class EditorWindow:
|
|||
|
||||
def ispythonsource(self, filename):
|
||||
if not filename:
|
||||
return 1
|
||||
return True
|
||||
base, ext = os.path.splitext(os.path.basename(filename))
|
||||
if os.path.normcase(ext) in (".py", ".pyw"):
|
||||
return 1
|
||||
return True
|
||||
try:
|
||||
f = open(filename)
|
||||
line = f.readline()
|
||||
f.close()
|
||||
except IOError:
|
||||
return 0
|
||||
return False
|
||||
return line[:2] == '#!' and string.find(line, 'python') >= 0
|
||||
|
||||
def close_hook(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue