Commit f78c3bea authored by Jason R. Coombs's avatar Jason R. Coombs

Use context manager

parent 20ee765d
......@@ -1507,11 +1507,8 @@ class DefaultProvider(EggProvider):
return open(self._fn(self.module_path, resource_name), 'rb')
def _get(self, path):
stream = open(path, 'rb')
try:
with open(path, 'rb') as stream:
return stream.read()
finally:
stream.close()
register_loader_type(type(None), DefaultProvider)
......
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