Update core.py (#1627)

This commit is contained in:
Xingdong Zuo
2019-10-26 00:48:21 +02:00
committed by pzhokhov
parent 53b301af5e
commit 0cd9266d98

View File

@@ -145,9 +145,11 @@ class Env(object):
return '<{}<{}>>'.format(type(self).__name__, self.spec.id)
def __enter__(self):
"""Support with-statement for the environment. """
return self
def __exit__(self, *args):
"""Support with-statement for the environment. """
self.close()
# propagate exception
return False