micropython

Changeset

541:ad2a6b7ef7bb
2012-06-11 Paul Boddie raw files shortlog changelog graph Introduced an explicit test for non-class base class references.
micropython/inspect.py (file)
     1.1 --- a/micropython/inspect.py	Sun Jun 10 21:50:53 2012 +0200
     1.2 +++ b/micropython/inspect.py	Mon Jun 11 00:40:17 2012 +0200
     1.3 @@ -824,6 +824,8 @@
     1.4                  if isinstance(expr, Attr):
     1.5                      if expr.assignments != 1:
     1.6                          raise InspectError("Base class %r for %r is not constant: %r" % (base, cls.full_name(), expr))
     1.7 +                    elif not isinstance(expr.get_value(), Class):
     1.8 +                        raise InspectError("Base class %r for %r is not a class: %r" % (base, cls.full_name(), expr.get_value()))
     1.9                      else:
    1.10                          cls.add_base(expr.get_value())
    1.11