Fix a few issues with the newly defined CompiledValue
This commit is contained in:
1 parent
d07d1a78d3
commit
62df944c47
4 files changed
+14
-10
No files matched your search
@@ -250,11 +250,13 @@ def _getitem(context, index_contexts, contextualized_node):
|
||||
index = index_context
|
||||
if isinstance(index_context, Slice):
|
||||
index = index.obj
|
||||
if isinstance(index, CompiledObject):
|
||||
try:
|
||||
index = index.get_safe_value()
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
try:
|
||||
method = index.get_safe_value
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
index = method(default=None)
|
||||
|
||||
if type(index) in (float, int, str, unicode, slice, bytes):
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user