diff options
Diffstat (limited to 'Lib/distutils/command/config.py')
-rw-r--r-- | Lib/distutils/command/config.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Lib/distutils/command/config.py b/Lib/distutils/command/config.py index 34f9188..144c513 100644 --- a/Lib/distutils/command/config.py +++ b/Lib/distutils/command/config.py @@ -336,11 +336,16 @@ class config(Command): def dump_file(filename, head=None): + """Dumps a file content into log.info. + + If head is not None, will be dumped before the file content. + """ if head is None: - print(filename + ":") + log.info('%s' % filename) else: - print(head) - + log.info(head) file = open(filename) - sys.stdout.write(file.read()) - file.close() + try: + log.info(file.read()) + finally: + file.close() |