File tree 1 file changed +11
-9
lines changed
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,17 @@ def read_clipboard(**kwargs): # pragma: no cover
18
18
from pandas .io .parsers import read_table
19
19
text = clipboard_get ()
20
20
21
+ # try to decode (if needed on PY3)
22
+ # Strange. linux py33 doesn't complain, win py33 does
23
+ if compat .PY3 :
24
+ try :
25
+ text = compat .bytes_to_str (
26
+ text , encoding = (kwargs .get ('encoding' ) or
27
+ get_option ('display.encoding' ))
28
+ )
29
+ except :
30
+ pass
31
+
21
32
# Excel copies into clipboard with \t seperation
22
33
# inspect no more then the 10 first lines, if they
23
34
# all contain an equal number (>0) of tabs, infer
@@ -37,15 +48,6 @@ def read_clipboard(**kwargs): # pragma: no cover
37
48
if kwargs .get ('sep' ) is None and kwargs .get ('delim_whitespace' ) is None :
38
49
kwargs ['sep' ] = '\s+'
39
50
40
- # try to decode (if needed on PY3)
41
- if compat .PY3 :
42
- try :
43
- text = compat .bytes_to_str (
44
- text , encoding = (kwargs .get ('encoding' ) or
45
- get_option ('display.encoding' ))
46
- )
47
- except :
48
- pass
49
51
return read_table (StringIO (text ), ** kwargs )
50
52
51
53
You can’t perform that action at this time.
0 commit comments