Skip to content

Commit

Permalink
Remove use of imp
Browse files Browse the repository at this point in the history
The replacements in `importlib.util` have been available since Python
3.5.
  • Loading branch information
sampsyo committed Aug 21, 2022
1 parent 2c9f699 commit 63b7595
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@

# Mock GstPlayer so that the forked process doesn't attempt to import gi:
from unittest import mock
import imp
gstplayer = imp.new_module("beetsplug.bpd.gstplayer")
import importlib.util
gstplayer = importlib.util.module_from_spec(
importlib.util.find_spec("beetsplug.bpd.gstplayer")
)
def _gstplayer_play(*_): # noqa: 42
bpd.gstplayer._GstPlayer.playing = True
return mock.DEFAULT
Expand Down

0 comments on commit 63b7595

Please sign in to comment.