[pypy-commit] pypy no-class-specialize: fix imports
rlamy
noreply at buildbot.pypy.org
Wed Oct 14 02:43:43 CEST 2015
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: no-class-specialize
Changeset: r80188:dc1d07c7ac73
Date: 2015-10-14 01:43 +0100
http://bitbucket.org/pypy/pypy/changeset/dc1d07c7ac73/
Log: fix imports
diff --git a/rpython/annotator/builtin.py b/rpython/annotator/builtin.py
--- a/rpython/annotator/builtin.py
+++ b/rpython/annotator/builtin.py
@@ -4,13 +4,14 @@
import sys
from rpython.annotator.model import (
- SomeInteger, SomeObject, SomeChar, SomeBool, SomeString, SomeTuple,
+ SomeInteger, SomeChar, SomeBool, SomeString, SomeTuple,
SomeUnicodeCodePoint, SomeFloat, unionof, SomeUnicodeString,
SomePBC, SomeInstance, SomeDict, SomeList, SomeWeakRef, SomeIterator,
SomeOrderedDict, SomeByteArray, add_knowntypedata, s_ImpossibleValue,)
from rpython.annotator.bookkeeper import (
getbookkeeper, immutablevalue, BUILTIN_ANALYZERS, analyzer_for)
from rpython.annotator import description
+from rpython.annotator.classdesc import ClassDef
from rpython.flowspace.model import Constant
import rpython.rlib.rarithmetic
import rpython.rlib.objectmodel
@@ -123,7 +124,6 @@
def our_issubclass(cls1, cls2):
""" we're going to try to be less silly in the face of old-style classes"""
- from rpython.annotator.classdef import ClassDef
if cls2 is object:
return True
def classify(cls):
diff --git a/rpython/annotator/classdesc.py b/rpython/annotator/classdesc.py
--- a/rpython/annotator/classdesc.py
+++ b/rpython/annotator/classdesc.py
@@ -118,14 +118,10 @@
for desc in s_newvalue.descriptions:
if desc.selfclassdef is None:
if homedef.classdesc.settled:
- raise Exception("demoting method %s "
- "to settled class %s not "
- "allowed" %
- (self.name, homedef)
- )
- #self.bookkeeper.warning("demoting method %s "
- # "to base class %s" %
- # (self.name, homedef))
+ raise AnnotatorError(
+ "demoting method %s to settled class "
+ "%s not allowed" % (self.name, homedef)
+ )
break
# check for attributes forbidden by slots or _attrs_
@@ -616,7 +612,6 @@
return self.getuniqueclassdef()
def _init_classdef(self):
- from rpython.annotator.classdef import ClassDef
classdef = ClassDef(self.bookkeeper, self)
self.bookkeeper.classdefs.append(classdef)
self.classdef = classdef
@@ -731,7 +726,6 @@
if classdef is not None:
s_value = s_value.bind_callables_under(classdef, name)
elif isinstance(obj, Desc):
- from rpython.annotator.model import SomePBC
if classdef is not None:
obj = obj.bind_under(classdef, name)
s_value = SomePBC([obj])
diff --git a/rpython/annotator/test/test_annrpython.py b/rpython/annotator/test/test_annrpython.py
--- a/rpython/annotator/test/test_annrpython.py
+++ b/rpython/annotator/test/test_annrpython.py
@@ -6,7 +6,7 @@
from rpython.annotator import model as annmodel
from rpython.annotator.model import AnnotatorError, UnionError
from rpython.annotator.annrpython import RPythonAnnotator as _RPythonAnnotator
-from rpython.annotator.classdef import NoSuchAttrError
+from rpython.annotator.classdesc import NoSuchAttrError
from rpython.translator.translator import graphof as tgraphof
from rpython.annotator.policy import AnnotatorPolicy
from rpython.annotator.signature import Sig, SignatureError
@@ -3049,7 +3049,6 @@
if works:
a.build_types(fun, [int])
else:
- from rpython.annotator.classdef import NoSuchAttrError
py.test.raises(NoSuchAttrError, a.build_types, fun, [int])
def test_attrs_enforce_attrs(self):
More information about the pypy-commit
mailing list