[PEAK] DecoratorTools break when optimized.

Sergey Schetinin maluke at gmail.com
Fri Apr 4 21:04:58 EDT 2008


When the app is build with -OO flag (which removes asserts and
docstrings) the DecoratorTools fail (and PEAK-Rules via dependency).
Sample traceback:


Traceback (most recent call last):
  File "main.py", line 1, in <module>
  File "boilerplate.pyo", line 1, in <module>
  File "awsui\aws_application.pyo", line 8, in <module>
  File "gui2\__init__.pyo", line 14, in <module>
  File "gui2\guiapplication.pyo", line 13, in <module>
  File "wxgui\__init__.pyo", line 1, in <module>
  File "gui\__init__.pyo", line 1, in <module>
  File "gui\api\__init__.pyo", line 1, in <module>
  File "gui\api\private.pyo", line 1, in <module>
  File "peak\rules\__init__.pyo", line 3, in <module>
  File "peak\rules\core.pyo", line 247, in <module>
  File "peak\rules\core.pyo", line 268, in RuleSet
  File "peak\rules\core.pyo", line 268, in RuleSet
  File "peak\util\decorators.pyo", line 576, in tracer
  File "peak\util\decorators.pyo", line 302, in <lambda>
  File "peak\util\decorators.pyo", line 321, in synchronized
AttributeError: 'NoneType' object has no attribute 'replace'

The error is caused by this line:
    wrap.__doc__ = wrap.__doc__.replace('$self', first_arg)

Obviously, it can't work without a docstring. I hope that this will be
considered a bug, not just a limitation. It can be worked around by
storing a copy of the docstring in some other attribute for these
template functions.

-- 
Best Regards,
Sergey Schetinin

http://s3bk.com/ -- S3 Backup
http://word-to-html.com/ -- Word to HTML Converter



More information about the PEAK mailing list