From a08279f8dfeafad8e797da26d08c0ced590de1af Mon Sep 17 00:00:00 2001 From: Carlos Cordoba <ccordoba12@gmail.com> Date: Tue, 6 Oct 2015 12:12:24 -0500 Subject: [PATCH] Variable Explorer: Fix a freeze when creating empty DataFrames on PY2 Fixes #2744 --- spyderlib/widgets/dicteditorutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spyderlib/widgets/dicteditorutils.py b/spyderlib/widgets/dicteditorutils.py index 9cfa912c2ac..d99e3f8705c 100644 --- a/spyderlib/widgets/dicteditorutils.py +++ b/spyderlib/widgets/dicteditorutils.py @@ -186,7 +186,7 @@ def value_to_display(value, truncate=False, trunc_len=80, minmax=False): return '%s Mode: %s' % (address(value), value.mode) if isinstance(value, DataFrame): cols = value.columns - if PY2: + if PY2 and cols: # Get rid of possible BOM utf-8 data present at the # beginning of a file, which gets attached to the first # column header when headers are present in the first