mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 10:15:11 +00:00
add comment and adjust striatation spacing
This commit is contained in:
parent
a811d79754
commit
19f968cb92
1 changed files with 2 additions and 1 deletions
|
|
@ -5,11 +5,11 @@ try:
|
|||
except ImportError:
|
||||
from collections import Mapping, Sequence
|
||||
from copy import deepcopy
|
||||
|
||||
from . import utils
|
||||
from . import pycompat
|
||||
|
||||
|
||||
# Check whether code needs parentheses or not. If parentheses are needed, return true
|
||||
def needs_parentheses(source):
|
||||
def code(s):
|
||||
return compile(s, '<variable>', 'eval').co_code
|
||||
|
|
@ -32,6 +32,7 @@ class BaseVariable(pycompat.ABC):
|
|||
main_value = eval(self.code, frame.f_globals or {}, frame.f_locals)
|
||||
except Exception:
|
||||
return ()
|
||||
|
||||
return self._items(main_value, normalize)
|
||||
|
||||
@abc.abstractmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue