Skip to content

Commit 5b01a03

Browse files
author
Jeff Whitaker
committed
get rid of 'U' in mode flag for gzipped files.
svn path=/trunk/matplotlib/; revision=6852
1 parent 1be9a1a commit 5b01a03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/cbook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ def to_filehandle(fname, flag='rU', return_opened=False):
311311
if is_string_like(fname):
312312
if fname.endswith('.gz'):
313313
import gzip
314-
# universal newline mode doesn't work for gzipped files.
315-
if flag == 'rU': flag = 'r'
314+
# get rid of 'U' in flag for gzipped files.
315+
flag = flag.replace('U','')
316316
fh = gzip.open(fname, flag)
317317
else:
318318
fh = file(fname, flag)

0 commit comments

Comments
 (0)