[Ironpython-users] Patch: Warn user when using old print syntax

Markus Schaber m.schaber at 3s-software.com
Thu Oct 13 10:26:18 CEST 2011


Von: ironpython-users-bounces+m.schaber=3s-software.com at python.org
> Von: Markus Schaber
> > The patch below emits a warning during Compilation for print
> > statements whose argument list does not start with a '(' if Py3k warnings
> are enabled.
> Somehow, this patch leads to a StackOverFlowException in some cases, so
> please don't apply it.
> (It seemed to work fine in my tests yesterday, though.)

The reason for that is that my tests yesterday involved only Compilation of ScriptSources. When actually executing a script, however, import of modules triggers their compilation, and then warnings are dispatched to the warnings module, instead of the ErrorListener used for Compilation.

> I'm still investigating, but it seems that ErrorSink.Add tries to import
> the Warnings module, which itself triggers that warning recursively.

> Maybe we should find a way to exclude the standard library from this kind
> of warning? I'll try to check how it is done for -t - or do we simply rely
> on the fact that the warnings module itself has a consistent indentation?

Best regards

Markus Schaber
We software Automation.

3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50

Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com 
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 

More information about the Ironpython-users mailing list