From c8ccb5b1f89424cf89593077a51e4b1819302d2f Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 26 Nov 2010 14:00:21 +0100 Subject: [PATCH] compile modules Cython.Compiler.Nodes and Cython.Compiler.ExprNodes --- Cython/Compiler/ExprNodes.py | 23 ++++++++++++++--------- setup.py | 4 +++- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 943ff495..c11a3ad6 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2,9 +2,19 @@ # Pyrex - Parse tree nodes for expressions # +import cython +from cython import set +cython.declare(error=object, warning=object, warn_once=object, InternalError=object, + CompileError=object, UtilityCode=object, StringEncoding=object, operator=object, + Naming=object, Nodes=object, PyrexTypes=object, py_object_type=object, + list_type=object, tuple_type=object, set_type=object, dict_type=object, \ + unicode_type=object, str_type=object, bytes_type=object, type_type=object, + Builtin=object, Symtab=object, Utils=object, find_coercion_error=object, + debug_disposal_code=object, debug_temp_alloc=object, debug_coercion=object) + import operator -from Errors import error, warning, warn_once, InternalError +from Errors import error, warning, warn_once, InternalError, CompileError from Errors import hold_errors, release_errors, held_errors, report_error from Code import UtilityCode import StringEncoding @@ -21,17 +31,11 @@ import Symtab import Options from Cython import Utils from Annotate import AnnotationItem -from Cython import Utils from Cython.Debugging import print_call_chain from DebugFlags import debug_disposal_code, debug_temp_alloc, \ debug_coercion -try: - set -except NameError: - from sets import Set as set - class NotConstant(object): def __repr__(self): return "" @@ -202,8 +206,9 @@ class ExprNode(Node): _get_child_attrs = operator.attrgetter('subexprs') except AttributeError: # Python 2.3 - def _get_child_attrs(self): + def __get_child_attrs(self): return self.subexprs + _get_child_attrs = __get_child_attrs child_attrs = property(fget=_get_child_attrs) def not_implemented(self, method_name): @@ -3153,7 +3158,7 @@ class GeneralCallNode(CallNode): def explicit_args_kwds(self): if self.starstar_arg or not isinstance(self.positional_args, TupleNode): - raise PostParseError(self.pos, + raise CompileError(self.pos, 'Compile-time keyword arguments must be explicit.') return self.positional_args.args, self.keyword_args diff --git a/setup.py b/setup.py index 29ddfc42..e8e24b53 100644 --- a/setup.py +++ b/setup.py @@ -92,8 +92,10 @@ def compile_cython_modules(profile=False): "Cython.Compiler.Parsing", "Cython.Compiler.Visitor", "Cython.Compiler.ParseTreeTransforms", - "Cython.Compiler.Optimize", + "Cython.Compiler.Nodes", + "Cython.Compiler.ExprNodes", "Cython.Compiler.ModuleNode", + "Cython.Compiler.Optimize", "Cython.Runtime.refnanny"] extensions = [] -- 2.26.2