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/2008-September/082656.html below:

[Python-Dev] when is path==NULL?

[Python-Dev] when is path==NULL?Thomas Lee tom at vector-seven.com
Tue Sep 30 14:46:08 CEST 2008
Ulrich Eckhardt wrote:
> Hi!
>
> I'm looking at trunk/Python/sysmodule.c, function PySys_SetArgv(). In that 
> function, there is code like this:
>
>   PyObject* path = PySys_GetObject("path");
>   ...
>   if (path != NULL) {
>     ...
>   }
>
> My intuition says that if path==NULL, something is very wrong. At least I 
> would expect to get 'None', but never NULL, except when out of memory. So, 
> for the case that path==NULL', I would simply invoke Py_FatalError("no mem 
> for sys.path"), similarly to the other call there.
>
> Sounds reasonable?
>
> Uli
>
>   
I also meant to mention that there might be a reason why we want the out 
of memory error to bubble up to the caller should that happen while 
attempting to allocate the PyString in PyDict_GetItemString, rather than 
just bailing out with a generic FatalError.

Cheers,
T
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