From: Robert Bradshaw Date: Tue, 2 Feb 2010 12:12:52 +0000 (-0800) Subject: cython.directive(None) clears directive setting back to default value X-Git-Tag: 0.13.beta0~355 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a704e2009ebcc1860f0822724c1ed5d0564bfcdf;p=cython.git cython.directive(None) clears directive setting back to default value --- diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index c302210a..402a0221 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -461,17 +461,8 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations): def try_to_parse_directive(self, optname, args, kwds, pos): directivetype = Options.directive_types.get(optname) - if optname == 'infer_types': - if kwds is not None or len(args) != 1: - raise PostParseError(pos, - 'The %s directive takes one compile-time boolean argument' % optname) - elif isinstance(args[0], BoolNode): - return (optname, args[0].value) - elif isinstance(args[0], NoneNode): - return (optname, None) - else: - raise PostParseError(pos, - 'The %s directive takes one compile-time boolean argument' % optname) + if len(args) == 1 and isinstance(args[0], NoneNode): + return optname, Options.directive_defaults[optname] elif directivetype is bool: if kwds is not None or len(args) != 1 or not isinstance(args[0], BoolNode): raise PostParseError(pos,