346 if not hasattr(module, "python2Compatible"): |
346 if not hasattr(module, "python2Compatible"): |
347 module.error = self.tr( |
347 module.error = self.tr( |
348 "Module is missing the Python2 compatibility flag." |
348 "Module is missing the Python2 compatibility flag." |
349 " Please update.") |
349 " Please update.") |
350 compatible = False |
350 compatible = False |
351 elif getattr(module, "python2Compatible"): |
351 elif not getattr(module, "python2Compatible"): |
352 module.error = self.tr( |
352 module.error = self.tr( |
353 "Module is not Python2 compatible.") |
353 "Module is not Python2 compatible.") |
354 compatible = False |
354 compatible = False |
355 else: |
355 else: |
356 compatible = True |
356 compatible = True |
376 imp.reload(module) |
376 imp.reload(module) |
377 except PluginLoadError: |
377 except PluginLoadError: |
378 print("Error loading plug-in module:", name) |
378 print("Error loading plug-in module:", name) |
379 except PluginPy2IncompatibleError: |
379 except PluginPy2IncompatibleError: |
380 print("Error loading plug-in module:", name) |
380 print("Error loading plug-in module:", name) |
381 print("Th plug-in is not Python2 compatible.") |
381 print("The plug-in is not Python2 compatible.") |
382 except Exception as err: |
382 except Exception as err: |
383 module = imp.new_module(name) |
383 module = imp.new_module(name) |
384 module.error = self.tr( |
384 module.error = self.tr( |
385 "Module failed to load. Error: {0}").format(str(err)) |
385 "Module failed to load. Error: {0}").format(str(err)) |
386 self.__failedModules[name] = module |
386 self.__failedModules[name] = module |