from asyncio.events import BaseDefaultEventLoopPolicy
from asyncio import SelectorEventLoop, set_event_loop_policy
from wpilib import Timer


class FPGATimedEventLoop(SelectorEventLoop):
    """An asyncio event loop that uses wpilib time rather than python time"""
    def time(self):
        return Timer.getFPGATimestamp()


class FPGATimedEventLoopPolicy(BaseDefaultEventLoopPolicy):
    """An asyncio event loop policy that uses FPGATimedEventLoop"""
    _loop_factory = FPGATimedEventLoop


def patch_asyncio_policy():
    """
    Sets an instance of FPGATimedEventLoopPolicy as the default asyncio event
    loop policy
    """
    set_event_loop_policy(FPGATimedEventLoopPolicy())
from asyncio.events import AbstractEventLoopPolicy
from asyncio import SelectorEventLoop, set_event_loop_policy
from wpilib import Timer


class FPGATimedEventLoop(SelectorEventLoop):
    """An asyncio event loop that uses wpilib time rather than python time"""
    def time(self):
        return Timer.getFPGATimestamp()


class FPGATimedEventLoopPolicy(AbstractEventLoopPolicy):
    """An asyncio event loop policy that uses FPGATimedEventLoop"""
    _loop_factory = FPGATimedEventLoop


def patch_asyncio_policy():
    """
    Sets an instance of FPGATimedEventLoopPolicy as the default asyncio event
    loop policy
    """
    set_event_loop_policy(FPGATimedEventLoopPolicy())
Update asyncio policy to match newer asyncio version
Update asyncio policy to match newer asyncio version

- from asyncio.events import BaseDefaultEventLoopPolicy
+ from asyncio.events import AbstractEventLoopPolicy
  from asyncio import SelectorEventLoop, set_event_loop_policy
  from wpilib import Timer
  
  
  class FPGATimedEventLoop(SelectorEventLoop):
      """An asyncio event loop that uses wpilib time rather than python time"""
      def time(self):
          return Timer.getFPGATimestamp()
  
  
- class FPGATimedEventLoopPolicy(BaseDefaultEventLoopPolicy):
+ class FPGATimedEventLoopPolicy(AbstractEventLoopPolicy):
      """An asyncio event loop policy that uses FPGATimedEventLoop"""
      _loop_factory = FPGATimedEventLoop
  
  
  def patch_asyncio_policy():
      """
      Sets an instance of FPGATimedEventLoopPolicy as the default asyncio event
      loop policy
      """
      set_event_loop_policy(FPGATimedEventLoopPolicy())
Update asyncio policy to match newer asyncio version
## Code Before:
from asyncio.events import BaseDefaultEventLoopPolicy
from asyncio import SelectorEventLoop, set_event_loop_policy
from wpilib import Timer


class FPGATimedEventLoop(SelectorEventLoop):
    """An asyncio event loop that uses wpilib time rather than python time"""
    def time(self):
        return Timer.getFPGATimestamp()


class FPGATimedEventLoopPolicy(BaseDefaultEventLoopPolicy):
    """An asyncio event loop policy that uses FPGATimedEventLoop"""
    _loop_factory = FPGATimedEventLoop


def patch_asyncio_policy():
    """
    Sets an instance of FPGATimedEventLoopPolicy as the default asyncio event
    loop policy
    """
    set_event_loop_policy(FPGATimedEventLoopPolicy())
## Instruction:
Update asyncio policy to match newer asyncio version
## Code After:
from asyncio.events import AbstractEventLoopPolicy
from asyncio import SelectorEventLoop, set_event_loop_policy
from wpilib import Timer


class FPGATimedEventLoop(SelectorEventLoop):
    """An asyncio event loop that uses wpilib time rather than python time"""
    def time(self):
        return Timer.getFPGATimestamp()


class FPGATimedEventLoopPolicy(AbstractEventLoopPolicy):
    """An asyncio event loop policy that uses FPGATimedEventLoop"""
    _loop_factory = FPGATimedEventLoop


def patch_asyncio_policy():
    """
    Sets an instance of FPGATimedEventLoopPolicy as the default asyncio event
    loop policy
    """
    set_event_loop_policy(FPGATimedEventLoopPolicy())