eric6/Project/ProjectSourcesBrowser.py

changeset 7785
9978016560ec
parent 7780
41420f82c0ac
child 7836
2f0d208b8137
equal deleted inserted replaced
7784:3257703e10c5 7785:9978016560ec
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(

eric ide

mercurial