--- a/eric6/Project/Project.py Wed Apr 21 17:56:12 2021 +0200 +++ b/eric6/Project/Project.py Wed Apr 21 19:40:50 2021 +0200 @@ -607,10 +607,11 @@ } # Sources - if self.pdata["MIXEDLANGUAGE"]: - sourceKey = "Mixed" - else: - sourceKey = self.pdata["PROGLANGUAGE"] + sourceKey = ( + "Mixed" + if self.pdata["MIXEDLANGUAGE"] else + self.pdata["PROGLANGUAGE"] + ) for ext in self.__sourceExtensions(sourceKey): self.pdata["FILETYPES"]["*{0}".format(ext)] = "SOURCES" @@ -3130,13 +3131,12 @@ @return flag indicating success (boolean) """ defaultFilter = self.tr("Project Files (*.epj)") - if self.ppath: - defaultPath = self.ppath - else: - defaultPath = ( - Preferences.getMultiProject("Workspace") or - Utilities.getHomeDir() - ) + defaultPath = ( + self.ppath + if self.ppath else + (Preferences.getMultiProject("Workspace") or + Utilities.getHomeDir()) + ) fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( self.parent(), self.tr("Save project as"), @@ -4646,13 +4646,11 @@ newSources = os.listdir(curpath) except OSError: newSources = [] - if self.pdata["TRANSLATIONPATTERN"]: - pattern = ( - self.pdata["TRANSLATIONPATTERN"] - .replace("%language%", "*") - ) - else: - pattern = "*.ts" + pattern = ( + self.pdata["TRANSLATIONPATTERN"].replace("%language%", "*") + if self.pdata["TRANSLATIONPATTERN"] else + "*.ts" + ) binpattern = self.__binaryTranslationFile(pattern) for ns in newSources: # ignore hidden files and directories @@ -5422,12 +5420,12 @@ continue names = sorted(names) - if archiveName: - archive = os.path.join(self.ppath, archiveName) - else: - archive = os.path.join( - self.ppath, - self.pdata["MAINSCRIPT"].replace(".py", ".zip")) + archive = ( + os.path.join(self.ppath, archiveName) + if archiveName else + os.path.join(self.ppath, + self.pdata["MAINSCRIPT"].replace(".py", ".zip")) + ) try: archiveFile = zipfile.ZipFile(archive, "w") except OSError as why: @@ -5658,10 +5656,11 @@ ): return - if self.pdata["MAKEPARAMS"]["MakeExecutable"]: - prog = self.pdata["MAKEPARAMS"]["MakeExecutable"] - else: - prog = Project.DefaultMake + prog = ( + self.pdata["MAKEPARAMS"]["MakeExecutable"] + if self.pdata["MAKEPARAMS"]["MakeExecutable"] else + Project.DefaultMake + ) args = [] if self.pdata["MAKEPARAMS"]["MakeParameters"]: