Skip to content

Commit 51a09cf

Browse files
committed
CLN: More cleanup and comments
1 parent 009bb92 commit 51a09cf

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

pandas/io/clipboards.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,10 @@ def read_clipboard(sep=r'\s+', **kwargs): # pragma: no cover
3434

3535
from pandas.io.clipboard import clipboard_get
3636
from pandas.io.parsers import read_csv
37-
text = clipboard_get()
3837

39-
# try to decode (if needed)
40-
# Strange. linux py33 doesn't complain, win py33 does
41-
try:
42-
text = compat.bytes_to_str(
43-
text, encoding=(kwargs.get('encoding') or
44-
get_option('display.encoding'))
45-
)
46-
except AttributeError:
47-
pass
38+
text = clipboard_get()
39+
text = compat.bytes_to_str(text, encoding=(kwargs.get('encoding') or
40+
get_option('display.encoding')))
4841

4942
# Excel copies into clipboard with \t separation
5043
# inspect no more then the 10 first lines, if they

pandas/io/common.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,10 @@ def next(self):
491491
return next(self.reader).encode("utf-8")
492492

493493

494+
# Keeping these class for now because it provides a necessary convenience
495+
# for "dropping" the "encoding" argument from our I/O arguments when
496+
# creating a Unicode I/O object.
494497
def UnicodeReader(f, dialect=csv.excel, encoding="utf-8", **kwds):
495-
# ignore encoding
496498
return csv.reader(f, dialect=dialect, **kwds)
497499

498500

pandas/io/formats/terminal.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Terminal utilities.
33
"""
4-
from __future__ import print_function
54

65
__all__ = ['is_terminal']
76

0 commit comments

Comments
 (0)