Skip to content

Commit

Permalink
Convert QByteArray to unicode to fix exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mwiencek committed Jan 17, 2014
1 parent 68bf155 commit f903121
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions picard/util/cdrom.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,16 @@ def get_cdrom_drives():
if cdinfo.open(QIODevice.ReadOnly | QIODevice.Text):
drive_names = []
drive_audio_caps = []
line = cdinfo.readLine()
line = unicode(cdinfo.readLine())
while line:
if line.indexOf(':') != -1:
if ":" in line:
key, values = line.split(':')
if key == 'drive name':
drive_names = values.strip().split()
drive_names = values.split()
elif key == 'Can play audio':
drive_audio_caps = [v == '1' for v in
values.strip().split()]
drive_audio_caps = [v == '1' for v in values.split()]
break # no need to continue passed this line
line = cdinfo.readLine()
line = unicode(cdinfo.readLine())
# Show only drives that are capable of playing audio
for index, drive in enumerate(drive_names):
if drive_audio_caps[index]:
Expand Down

0 comments on commit f903121

Please sign in to comment.