Skip to content

Commit

Permalink
[python] Minor fix: close open file pointer (#2039)
Browse files Browse the repository at this point in the history
  • Loading branch information
erlinghaugstad authored and StrikerRUS committed Mar 7, 2019
1 parent 8aa08c4 commit 5801460
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python-package/lightgbm/__init__.py
Expand Up @@ -27,7 +27,8 @@
dir_path = os.path.dirname(os.path.realpath(__file__))

if os.path.isfile(os.path.join(dir_path, 'VERSION.txt')):
__version__ = open(os.path.join(dir_path, 'VERSION.txt')).read().strip()
with open(os.path.join(dir_path, 'VERSION.txt')) as version_file:
__version__ = version_file.read().strip()

__all__ = ['Dataset', 'Booster',
'train', 'cv',
Expand Down

0 comments on commit 5801460

Please sign in to comment.