Skip to content

Commit

Permalink
Cast num_sharps to int in mode_accidentals_to_key_number
Browse files Browse the repository at this point in the history
For Python 3 compatibility.
  • Loading branch information
craffel committed Sep 1, 2016
2 parents 2cb819d + 2bc2b0c commit c9700f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pretty_midi/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def mode_accidentals_to_key_number(mode, num_accidentals):
# check if key signature has sharps or flats
if num_accidentals >= 0:
num_sharps = num_accidentals / 6
key = sharp_keys[num_accidentals % 7] + '#' * num_sharps
key = sharp_keys[num_accidentals % 7] + '#' * int(num_sharps)
else:
if num_accidentals == -1:
key = 'F'
Expand Down

0 comments on commit c9700f2

Please sign in to comment.