Skip to content
Browse files

Fixes to utils.io.Tee

  • Loading branch information...
1 parent 1dcb5a6 commit 5299658e38c8ae6d73a33eb9c476e6a4a531a42e @takluyver committed Aug 10, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 IPython/utils/io.py
View
4 IPython/utils/io.py
@@ -103,7 +103,7 @@ class Tee(object):
# Inspired by:
# http://mail.python.org/pipermail/python-list/2007-May/442737.html
- def __init__(self, file_or_name, mode=None, channel='stdout'):
+ def __init__(self, file_or_name, mode="w", channel='stdout'):
"""Construct a new Tee object.
Parameters
@@ -119,7 +119,7 @@ def __init__(self, file_or_name, mode=None, channel='stdout'):
if channel not in ['stdout', 'stderr']:
raise ValueError('Invalid channel spec %s' % channel)
- if hasattr(file, 'write') and hasattr(file, 'seek'):
+ if hasattr(file_or_name, 'write') and hasattr(file_or_name, 'seek'):
self.file = file_or_name
else:
self.file = open(file_or_name, mode)

0 comments on commit 5299658

Please sign in to comment.
Something went wrong with that request. Please try again.