mirror of
https://github.com/openkmip/pykmip
synced 2026-01-07 11:03:16 +00:00
Fixing bug with dangling file handle when setting __version__
This change fixes a bug whereby a file handle was left unclosed after being used to dynamically set __version__.
This commit is contained in:
@@ -17,9 +17,11 @@ import logging.config
|
||||
import os
|
||||
import sys
|
||||
|
||||
version = os.path.join(os.path.dirname(
|
||||
# Dynamically set __version__
|
||||
version_path = os.path.join(os.path.dirname(
|
||||
os.path.realpath(__file__)), 'version.py')
|
||||
exec(open(version).read())
|
||||
with open(version_path, 'r') as version_file:
|
||||
exec(version_file.read())
|
||||
|
||||
path = os.path.join(os.path.dirname(__file__), 'logconfig.ini')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user