From: Collin Funk Date: Sun, 14 Apr 2024 16:37:17 +0000 (-0700) Subject: gnulib-tool.py: Remove some unused variable assignments. X-Git-Tag: v1.0~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3897b2b1ad4712dbbb32cb083a267c5f4fdaa260;p=thirdparty%2Fgnulib.git gnulib-tool.py: Remove some unused variable assignments. * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Remove unused variable. * pygnulib/GLInfo.py (GLInfo.date, GLInfo.version): Remove assignments to variables unconditionally set in try, except blocks. * pygnulib/GLModuleSystem.py (GLModule.getConditionalName) (GLModule.getShellFunc, GLModule.getShellVar): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 4333a003a5..0e24ce55d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2024-04-14 Collin Funk + + gnulib-tool.py: Remove some unused variable assignments. + * pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Remove unused + variable. + * pygnulib/GLInfo.py (GLInfo.date, GLInfo.version): Remove assignments + to variables unconditionally set in try, except blocks. + * pygnulib/GLModuleSystem.py (GLModule.getConditionalName) + (GLModule.getShellFunc, GLModule.getShellVar): Likewise. + 2024-04-14 Collin Funk gnulib-tool.py: Don't use mutable default arguments. diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index 6edad6619e..558f130bbb 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -324,7 +324,6 @@ class GLEmiter: for module in modules: if module_filter(module): if moduletable.isConditional(module): - shellvar = module.getShellVar() emit += ' %s=false\n' % module.getShellVar() # Emit the autoconf code for the conditional modules, each in a separate # function. This makes it possible to support cycles among conditional diff --git a/pygnulib/GLInfo.py b/pygnulib/GLInfo.py index 716d1ddf0d..c7de90376a 100644 --- a/pygnulib/GLInfo.py +++ b/pygnulib/GLInfo.py @@ -89,14 +89,12 @@ class GLInfo: def date(self) -> str: '''Return formatted string which contains date and time in GMT format.''' if isdir(DIRS['git']): - have_git = None try: sp.check_call(['git', '--version'], stdout=sp.DEVNULL) have_git = True except: have_git = False if have_git: - have_GNU_date = None try: sp.check_call(['date', '--version'], stdout=sp.DEVNULL) have_GNU_date = True @@ -332,7 +330,6 @@ Report bugs to .''' def version(self) -> str: '''Return formatted string which contains git version.''' if isdir(DIRS['git']): - have_git = None try: sp.check_call(['git', '--version'], stdout=sp.DEVNULL) have_git = True diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index 6639c9a6e8..2551e316e1 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -396,7 +396,6 @@ class GLModule: if char not in GLModule.shell_id_chars: valid_shell_id = False break - identifier = None if valid_shell_id: identifier = self.getName() else: @@ -414,7 +413,6 @@ class GLModule: if char not in GLModule.shell_id_chars: valid_shell_id = False break - identifier = None if valid_shell_id: identifier = self.getName() else: @@ -432,7 +430,6 @@ class GLModule: if char not in GLModule.shell_id_chars: valid_shell_id = False break - identifier = None if valid_shell_id: identifier = self.getName() else: