567 packageDir = None |
567 packageDir = None |
568 else: |
568 else: |
569 packageDir = os.path.join(destination, packageName) |
569 packageDir = os.path.join(destination, packageName) |
570 pluginFile = os.path.join(destination, pluginFileName) |
570 pluginFile = os.path.join(destination, pluginFileName) |
571 |
571 |
572 try: |
572 with contextlib.suppress(OSError, os.error): |
573 if packageDir and os.path.exists(packageDir): |
573 if packageDir and os.path.exists(packageDir): |
574 shutil.rmtree(packageDir) |
574 shutil.rmtree(packageDir) |
575 |
575 |
576 fnameo = "{0}o".format(pluginFile) |
576 fnameo = "{0}o".format(pluginFile) |
577 if os.path.exists(fnameo): |
577 if os.path.exists(fnameo): |
594 os.path.join(pluginDirCache, |
594 os.path.join(pluginDirCache, |
595 "{0}*.pyc".format(pluginFileName))): |
595 "{0}*.pyc".format(pluginFileName))): |
596 os.remove(fnamec) |
596 os.remove(fnamec) |
597 |
597 |
598 os.remove(pluginFile) |
598 os.remove(pluginFile) |
599 except (OSError, os.error): |
|
600 # ignore some exceptions |
|
601 pass |
|
602 |
599 |
603 |
600 |
604 class PluginInstallDialog(QDialog): |
601 class PluginInstallDialog(QDialog): |
605 """ |
602 """ |
606 Class for the dialog variant. |
603 Class for the dialog variant. |