summaryrefslogtreecommitdiff
path: root/Lib/distutils/command/config.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-04-12 14:53:51 +0000
committerTarek Ziadé <ziade.tarek@gmail.com>2009-04-12 14:53:51 +0000
commitaa48798f1e99f9ca6ce0e859288b5a7d0419d539 (patch)
tree54a668d3600430d26f0671ddf044ef25519306d9 /Lib/distutils/command/config.py
parent3c4a5463b2e022cc43478de78a0afbd283b3ddef (diff)
downloadcpython-git-aa48798f1e99f9ca6ce0e859288b5a7d0419d539.tar.gz
removed the print statements and added a test
Diffstat (limited to 'Lib/distutils/command/config.py')
-rw-r--r--Lib/distutils/command/config.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/Lib/distutils/command/config.py b/Lib/distutils/command/config.py
index 6b358cf250..c36456ad6a 100644
--- a/Lib/distutils/command/config.py
+++ b/Lib/distutils/command/config.py
@@ -354,13 +354,17 @@ class config (Command):
# class config
+def dump_file(filename, head=None):
+ """Dumps a file content into log.info.
-def dump_file (filename, head=None):
+ 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()