Skip to content

Commit

Permalink
fix len error (#5421)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanMatthewHuff authored Apr 23, 2019
1 parent c1c990d commit 3febb03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/2 Fixes/5420.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix error with bad len() values in variable explorer
10 changes: 8 additions & 2 deletions pythonFiles/datascience/getJupyterVariableValue.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@

# Find shape and count if available
if (hasattr(_VSCODE_evalResult, 'shape')):
_VSCODE_targetVariable['shape'] = str(_VSCODE_evalResult.shape)
try:
_VSCODE_targetVariable['shape'] = str(_VSCODE_evalResult.shape)
except TypeError:
pass

if (hasattr(_VSCODE_evalResult, '__len__')):
_VSCODE_targetVariable['count'] = len(_VSCODE_evalResult)
try:
_VSCODE_targetVariable['count'] = len(_VSCODE_evalResult)
except TypeError:
pass

# Get the string of the eval result, truncate it as it could be far too long
_VSCODE_targetValue = str(_VSCODE_evalResult)
Expand Down

0 comments on commit 3febb03

Please sign in to comment.