From 352d793b06942978eb0ce8c713348c55768d3a3b Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Tue, 16 Apr 2024 08:36:55 -0700 Subject: [PATCH 2/2] gnulib-tool.py: Prefer 'not in' over 'not ... in'. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet): Change conditional. * pygnulib/GLModuleSystem.py (GLModuleTable.addConditional): Likewise. --- ChangeLog | 6 ++++++ pygnulib/GLEmiter.py | 2 +- pygnulib/GLModuleSystem.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb91326403..186c8a6b39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-04-16 Collin Funk + + gnulib-tool.py: Prefer 'not in' over 'not ... in'. + * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippet): Change conditional. + * pygnulib/GLModuleSystem.py (GLModuleTable.addConditional): Likewise. + 2024-04-16 Collin Funk gnulib-tool.py: Make data structures more clear. diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index 558f130bbb..ff4e3027d6 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -218,7 +218,7 @@ def autoconfSnippet(self, module: GLModule, toplevel: bool, disable_libtool: boo if str(module) in ['gnumakefile', 'maintainer-makefile']: # These modules are meant to be used only in the top-level directory. flag = toplevel - else: # if not str(module) in ['gnumakefile', 'maintainer-makefile'] + else: # if str(module) not in ['gnumakefile', 'maintainer-makefile'] flag = True if flag: snippet = module.getAutoconfSnippet() diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index 11f8934026..3148f921e1 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -767,7 +767,7 @@ def addConditional(self, parent: GLModule, module: GLModule, condition: str | bo if not (type(condition) is str or condition == True): raise TypeError('condition must be a string or True, not %s' % type(condition).__name__) - if not str(module) in self.unconditionals: + if str(module) not in self.unconditionals: # No unconditional dependency to the given module is known at this point. if str(module) not in self.dependers: self.dependers[str(module)] = [] -- 2.44.0