예제 #1
0
파일: nodes.py 프로젝트: B-Rich/crashkit
 def from_untrusted(cls, value, lineno=None, environment=None):
     """Return a const object if the value is representable as
     constant value in the generated code, otherwise it will raise
     an `Impossible` exception.
     """
     from compiler import has_safe_repr
     if not has_safe_repr(value):
         raise Impossible()
     return cls(value, lineno=lineno, environment=environment)
예제 #2
0
 def from_untrusted(cls, value, lineno=None, environment=None):
     """Return a const object if the value is representable as
     constant value in the generated code, otherwise it will raise
     an `Impossible` exception.
     """
     from compiler import has_safe_repr
     if not has_safe_repr(value):
         raise Impossible()
     return cls(value, lineno=lineno, environment=environment)
예제 #3
0
 def from_untrusted(cls, value, lineno=None, environment=None):
     from compiler import has_safe_repr
     if not has_safe_repr(value):
         raise Impossible()
     return cls(value, lineno=lineno, environment=environment)
예제 #4
0
파일: nodes.py 프로젝트: Reve/eve
    def from_untrusted(cls, value, lineno=None, environment=None):
        from compiler import has_safe_repr

        if not has_safe_repr(value):
            raise Impossible()
        return cls(value, lineno=lineno, environment=environment)