Skip to content

Commit 0d3da87

Browse files
authored
export: Actually import ExpatError (#3529)
1 parent efffb0a commit 0d3da87

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/windows/export.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
except ImportError:
3939
from xml.dom import minidom as xml
4040

41+
from xml.parsers.expat import ExpatError
42+
4143
from PyQt5.QtCore import Qt, QCoreApplication, QTimer, QSize
4244
from PyQt5.QtWidgets import (
4345
QMessageBox, QDialog, QFileDialog, QDialogButtonBox, QPushButton
@@ -251,7 +253,7 @@ def __init__(self):
251253
xmldoc = xml.parse(preset_path)
252254
type = xmldoc.getElementsByTagName("type")
253255
presets.append(_(type[0].childNodes[0].data))
254-
256+
255257
except ExpatError as e:
256258
# This indicates an invalid Preset file - display an error and continue
257259
log.error("Failed to parse file '%s' as a preset: %s" % (preset_path, e))
@@ -573,10 +575,10 @@ def cboSimpleTarget_index_changed(self, widget, index):
573575
self.cboChannelLayout.setCurrentIndex(layout_index)
574576
break
575577
layout_index += 1
576-
578+
577579
# Free up DOM memory
578580
xmldoc.unlink()
579-
581+
580582
except ExpatError as e:
581583
# This indicates an invalid Preset file - display an error and continue
582584
log.error("Failed to parse file '%s' as a preset: %s" % (preset_path, e))

0 commit comments

Comments
 (0)