Fix ResourceFile.__enter__ not returning anything

This commit is contained in:
dgelessus 2019-09-29 15:09:41 +02:00
parent fdd04c944b
commit add22b704a
2 changed files with 2 additions and 1 deletions

View File

@ -189,6 +189,7 @@ Version 1.3.1 (next version)
* The ``'dcmp'`` ID used to decompress each resource is displayed.
* Fixed an incorrect ``options.packages`` in ``setup.cfg``, which made the library unusable except when installing from source using ``--editable``.
* Fixed ``ResourceFile.__enter__`` returning ``None``, which made it impossible to use ``ResourceFile`` properly in a ``with`` statement.
Version 1.3.0.post1
^^^^^^^^^^^^^^^^^^^

View File

@ -455,7 +455,7 @@ class ResourceFile(collections.abc.Mapping):
self._stream.close()
def __enter__(self):
pass
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()