Remove Python 2 compatibility in VectorEnv (#2034)

This commit is contained in:
Tristan Deleu
2020-09-12 00:07:27 +02:00
committed by GitHub
parent 75b5fabdab
commit 1a92bc6c83
2 changed files with 2 additions and 11 deletions

View File

@@ -68,12 +68,7 @@ class AsyncVectorEnv(VectorEnv):
"""
def __init__(self, env_fns, observation_space=None, action_space=None,
shared_memory=True, copy=True, context=None, daemon=True, worker=None):
try:
ctx = mp.get_context(context)
except AttributeError:
logger.warn('Context switching for `multiprocessing` is not '
'available in Python 2. Using the default context.')
ctx = mp
ctx = mp.get_context(context)
self.env_fns = env_fns
self.shared_memory = shared_memory
self.copy = copy