835 .format(packagePath, str(err))) |
835 .format(packagePath, str(err))) |
836 return |
836 return |
837 packageFile = os.path.join(packagePath, "__init__.py") |
837 packageFile = os.path.join(packagePath, "__init__.py") |
838 if not os.path.exists(packageFile): |
838 if not os.path.exists(packageFile): |
839 try: |
839 try: |
840 f = open(packageFile, "w", encoding="utf-8") |
840 with open(packageFile, "w", encoding="utf-8"): |
841 f.close() |
841 pass |
842 except IOError as err: |
842 except IOError as err: |
843 E5MessageBox.critical( |
843 E5MessageBox.critical( |
844 self, |
844 self, |
845 self.tr("Add new Python package"), |
845 self.tr("Add new Python package"), |
846 self.tr( |
846 self.tr( |