From 4fa04b0b177f5491a48afa3751b30d2a26814c0e Mon Sep 17 00:00:00 2001 From: Colin Raffel Date: Fri, 20 Oct 2017 22:20:29 -0500 Subject: [PATCH] Use insinstance(*, int) for tick check (#138) --- pretty_midi/pretty_midi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pretty_midi/pretty_midi.py b/pretty_midi/pretty_midi.py index 76d111c..a2d00fe 100644 --- a/pretty_midi/pretty_midi.py +++ b/pretty_midi/pretty_midi.py @@ -947,7 +947,7 @@ def tick_to_time(self, tick): if tick >= len(self.__tick_to_time): self._update_tick_to_time(tick) # Ticks should be integers - if type(tick) != int: + if not isinstance(tick, int): warnings.warn('tick should be an int.') # Otherwise just return the time return self.__tick_to_time[int(tick)]