summaryrefslogtreecommitdiff
path: root/pygnulib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-08-05 15:15:16 +0200
committerBruno Haible <bruno@clisp.org>2022-08-05 15:15:16 +0200
commiteb194fa7a5c8abc2e79ca608466b04dc89a7c67d (patch)
tree4316fe805a17686eb1ce49a3ca63ca9b22529442 /pygnulib
parent1f0e03e5a3e83d271c4aef05dbbb4850f66cee42 (diff)
downloadgnulib-eb194fa7a5c8abc2e79ca608466b04dc89a7c67d.tar.gz
gnulib-tool.py: Fix 'Undefined variable' errors.
* pygnulib/constants.py: Import codecs. * pygnulib/GLConfig.py (GLConfig.setLibName): Fix local variable reference. * pygnulib/GLFileSystem.py (GLFileSystem.lookup, GLFileAssistant.update): Fix local variable references. * pygnulib/GLEmiter.py (GLEmiter.po_POTFILES_in): Fix reference. * pygnulib/GLTestDir.py (GLMegaTestDir.execute): Define missing local variables.
Diffstat (limited to 'pygnulib')
-rw-r--r--pygnulib/GLConfig.py2
-rw-r--r--pygnulib/GLEmiter.py2
-rw-r--r--pygnulib/GLFileSystem.py6
-rw-r--r--pygnulib/GLTestDir.py3
-rw-r--r--pygnulib/constants.py1
5 files changed, 9 insertions, 5 deletions
diff --git a/pygnulib/GLConfig.py b/pygnulib/GLConfig.py
index 039b4f012d..cda218e423 100644
--- a/pygnulib/GLConfig.py
+++ b/pygnulib/GLConfig.py
@@ -764,7 +764,7 @@ class GLConfig(object):
self.table['libname'] = libname
else: # if type of libname is not str
raise TypeError('libname must be a string, not %s'
- % type(module).__name__)
+ % type(libname).__name__)
def resetLibName(self):
'''Reset the library name to 'libgnu'.'''
diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py
index b56e551f1d..b547fde7e7 100644
--- a/pygnulib/GLEmiter.py
+++ b/pygnulib/GLEmiter.py
@@ -450,7 +450,7 @@ USE_MSGCTXT = no\n"""
emit = ''
sourcebase = self.config['sourcebase']
sourcebase = '%s%s' % (self.sourcebase, os.path.sep)
- files = [ substart('lib/', sourcebase, file)
+ files = [ constants.substart('lib/', sourcebase, file)
for file in files ]
files = [ file
for file in files
diff --git a/pygnulib/GLFileSystem.py b/pygnulib/GLFileSystem.py
index 7bec0f9e6e..9e6161a24d 100644
--- a/pygnulib/GLFileSystem.py
+++ b/pygnulib/GLFileSystem.py
@@ -88,7 +88,7 @@ class GLFileSystem(object):
GLConfig: localpath.'''
if type(name) is not str:
raise TypeError('name must be a string, not %s'
- % type(module).__name__)
+ % type(name).__name__)
localpath = self.config['localpath']
# Each element in localpath is a directory whose contents overrides
# or amends the result of the lookup in the rest of localpath and
@@ -322,9 +322,9 @@ class GLFileAssistant(object):
raise GLError(17, original)
else: # if self.config['dryrun']
if already_present:
- print('Update file %s (backup in %s)' % (rewritten, backup))
+ print('Update file %s (backup in %s)' % (rewritten, backupname))
else: # if not already_present
- print('Replace file %s (backup in %s)' % (rewritten, backup))
+ print('Replace file %s (backup in %s)' % (rewritten, backupname))
def add_or_update(self, already_present):
'''GLFileAssistant.add_or_update(already_present)
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index 624a38317e..db74b9b4e3 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -906,6 +906,9 @@ class GLMegaTestDir(object):
Create a mega scratch package with the given modules one by one and all
together.'''
+ auxdir = self.config['auxdir']
+ verbose = self.config['verbosity']
+
megasubdirs = list()
modules = [ self.modulesystem.find(m)
for m in self.config['modules'] ]
diff --git a/pygnulib/constants.py b/pygnulib/constants.py
index ffee05846e..313aac94a1 100644
--- a/pygnulib/constants.py
+++ b/pygnulib/constants.py
@@ -25,6 +25,7 @@ import sys
import platform
import shutil
import tempfile
+import codecs
import subprocess as sp
import __main__ as interpreter