#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
if os.path.isfile(os.path.join(trypath,fname)):
root, ext = os.path.splitext(fname)
if ext != ".py": continue
if os.path.isfile(os.path.join(trypath,fname)):
root, ext = os.path.splitext(fname)
if ext != ".py": continue
- fc = open(os.path.join(trypath,fname)).read()
- iselal = bool("class ElementaryAlgorithm" in fc)
- if iselal and ext == '.py' and root != '__init__':
- files.append(root)
+ with open(os.path.join(trypath,fname)) as fc:
+ iselal = bool("class ElementaryAlgorithm" in fc.read())
+ if iselal and ext == '.py' and root != '__init__':
+ files.append(root)