os.path.sep should always have a clear value

This commit is contained in:
Dave Halter
2019-08-06 19:57:16 +02:00
parent 99008eef43
commit 81488bcd20
4 changed files with 17 additions and 5 deletions

View File

@@ -789,3 +789,13 @@ class EnumInstance(LazyContextWrapper):
))
for f in self._get_wrapped_context().get_filters():
yield f
def tree_name_to_contexts(func):
def wrapper(evaluator, context, tree_name):
if tree_name.value == 'sep' and context.is_module() and context.py__name__() == 'os.path':
return ContextSet({
compiled.create_simple_object(evaluator, os.path.sep),
})
return func(evaluator, context, tree_name)
return wrapper