We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4376e77 commit 58a0caaCopy full SHA for 58a0caa
python/utils.py
@@ -216,11 +216,11 @@ def _unloadPluginModules(packageName):
216
# if it looks like a Qt resource file, try to do a cleanup
217
# otherwise we might experience a segfault next time the plugin is loaded
218
# because Qt will try to access invalid plugin resource data
219
- if "resources" in mod:
220
- try:
221
- sys.modules[mod].qCleanupResources()
222
- except:
223
- pass
+ try:
+ if hasattr(sys.modules[mod], 'qCleanupResources'):
+ sys.modules[mod].qCleanupResources()
+ except:
+ pass
224
# try to remove the module from python
225
try:
226
del sys.modules[mod]
0 commit comments