Commit c434c04b authored by Jérome Perrin's avatar Jérome Perrin

proxy/db_version: prevent a ResourceWarning

parent e3c23562
...@@ -3,5 +3,6 @@ ...@@ -3,5 +3,6 @@
import pkg_resources import pkg_resources
from slapos.util import bytes2str from slapos.util import bytes2str
DB_VERSION = bytes2str(pkg_resources.resource_stream('slapos.proxy', 'schema.sql').readline()).strip().split(':')[1] with pkg_resources.resource_stream('slapos.proxy', 'schema.sql') as f:
DB_VERSION = bytes2str(f.readline()).strip().split(':')[1]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment