A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-May/045005.html below:

[Python-Dev] Re:import.c

[Python-Dev] Re:import.cPhillip J. Eby pje at telecommunity.com
Sat May 29 16:01:59 EDT 2004
At 09:46 PM 5/29/04 +0200, Wiktor Sadowski wrote:
>----------------------------------------------------------------------------
>--------
>in import_from (ceval.c):
>if (x == NULL && PyErr_ExceptionMatches(PyExc_AttributeError)) {
>      if(!PyModule_GetState(v))
>  /*raise the error and warn against circular import*/
>      else
>        /*default error*/
>----------------------------------------------------------------------------
>--------
>the same in PyGeneric_GetAttr (object.c):
>/* before raising an error*/
>if(PyModule_Check(obj) && !PyModule_GetState(obj))
>     /*add a circular import warning to the error string*/
>else
>   /*default error*/
>----------------------------------------------------------------------------
>--------

IMO, if this approach is used, the module type should instead get a custom 
tp_getattro method that checks the flag, rather than scattering this logic 
across unrelated functions.



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4