Skip to content

Commit 05eef39

Browse files
committed
COMP: Keep local functions out of global namespace
Remove unused variable warning.
1 parent 9f6cf00 commit 05eef39

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Wrapping/Generators/Python/itkConfig.py.in

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ NotInPlace: bool = False
5050
# Internal settings
5151

5252

53-
def itkFormatWarning(msg, *a, **kwa):
53+
def _itk_format_warning(msg, *_, **__):
5454
""""Format the warnings issued by itk to display only the message.
5555

5656
This will ignore the filename and the line number where the warning was
@@ -60,35 +60,35 @@ def itkFormatWarning(msg, *a, **kwa):
6060

6161

6262
# Redefine the format of the warnings
63-
warnings.formatwarning = itkFormatWarning
63+
warnings.formatwarning = _itk_format_warning
6464

6565

66-
def normalized_path(relative_posix_path):
66+
def _normalized_path(relative_posix_path):
6767
if relative_posix_path != "None":
6868
file_dir = os.path.split(__file__)[0]
6969
relative_path = relative_posix_path.replace("/", os.sep)
7070
return os.path.normpath(os.path.join(file_dir, relative_path))
7171

7272

7373
# swig_lib: location of the swig-generated shared libraries
74-
swig_lib = normalized_path("@CONFIG_PYTHON_SWIGLIB_DIR@")
74+
swig_lib = _normalized_path("@CONFIG_PYTHON_SWIGLIB_DIR@")
7575

7676
# swig_py: location of the xxxPython.py swig-generated python interfaces
77-
swig_py = normalized_path("@CONFIG_PYTHON_SWIGPY_DIR@")
77+
swig_py = _normalized_path("@CONFIG_PYTHON_SWIGPY_DIR@")
7878

7979
# config_py: location of xxxConfig.py CMake-generated library descriptions
80-
config_py = normalized_path("@CONFIG_PYTHON_CONFIGPY_DIR@")
80+
config_py = _normalized_path("@CONFIG_PYTHON_CONFIGPY_DIR@")
8181

8282
# put the itkConfig.py path in the path list
8383
path = [os.path.join(config_py, "..")]
8484
# also populate path with the WRAPITK_PYTHON_PATH var
8585
if "WRAPITK_PYTHON_PATH" in os.environ:
8686
path.extend(os.environ["WRAPITK_PYTHON_PATH"].split(":"))
8787

88-
doxygen_root = normalized_path("../Doc")
88+
doxygen_root = _normalized_path("../Doc")
8989

90-
ITK_GLOBAL_VERSION_STRING :str = "@ITK_VERSION_MAJOR@.@ITK_VERSION_MINOR@.@ITK_VERSION_PATCH@"
90+
ITK_GLOBAL_VERSION_STRING: str = "@ITK_VERSION_MAJOR@.@ITK_VERSION_MINOR@.@ITK_VERSION_PATCH@"
9191

92-
del normalized_path
92+
del _normalized_path
9393
del os
9494
del warnings

0 commit comments

Comments
 (0)