Skip to content

Commit

Permalink
Fix metaclass conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoH2O1999 committed Jul 28, 2022
1 parent 62cac5f commit 3ffa6f3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/poke_env/player/openai_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,19 @@ def _battle_finished_callback(
asyncio.run_coroutine_threadsafe(self.observations.async_put(to_put), POKE_LOOP)


class OpenAIGymEnv(Env, ABC): # pyre-ignore
class _EnvMetaclass(type(Env)): # pyre-ignore
pass


class _ABCMetaclass(type(ABC)): # pyre-ignore
pass


class _OpenAIGymEnvMetaclass(_EnvMetaclass, _ABCMetaclass):
pass


class OpenAIGymEnv(Env, ABC, metaclass=_OpenAIGymEnvMetaclass): # pyre-ignore

_INIT_RETRIES = 100
_TIME_BETWEEN_RETRIES = 0.5
Expand Down Expand Up @@ -162,7 +174,7 @@ def __init__(
"""
self.agent = _AsyncPlayer(
self,
username=self.__class__.__name__,
username=self.__class__.__name__, # pyre-ignore
player_configuration=player_configuration,
avatar=avatar,
battle_format=battle_format,
Expand Down

0 comments on commit 3ffa6f3

Please sign in to comment.