Commit 30ad859f by Andreas Fleig Committed by James Cammarata

ini_file: replace lambda with named function

Fixes #6876
parent 0da5996b
......@@ -95,6 +95,7 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese
changed = False
cp = ConfigParser.ConfigParser()
cp.optionxform = identity
try:
f = open(filename)
......@@ -151,6 +152,19 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese
return changed
# ==============================================================
# identity
def identity(arg):
"""
This function simply returns its argument. It serves as a
replacement for ConfigParser.optionxform, which by default
changes arguments to lower case. The identity function is a
better choice than str() or unicode(), because it is
encoding-agnostic.
"""
return arg
# ==============================================================
# main
def main():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment