On Mon, Jul 20, 2009 at 04:10:35PM +0200, Hrvoje Niksic wrote:
> To emulate the os-module-type calls, it's better to raise exceptions
> than return negative values:
> 
> > def setresuid(ruid, euid, suid):
> >     return _setresuid(__uid_t(ruid), __uid_t(euid), __uid_t(suid))
> 
> def setresuid(ruid, euid, suid):
>     res = _setresuid(__uid_t(ruid), __uid_t(euid), __uid_t(suid))
>     if res < 0:
>         raise OSError('[Errno %d] %s' % (os.errno, errno.strerror(os.errno)))

I am working on a module to implement all of this, but that raise command
won't work in Python 2.6.1; it turns out that os.errno is a module, not
an integer.  Does anyone know how to do what I want (that is, how to access
the errno set in C functions)?
-- 
Obama Nation | My emails do not have attachments; it's a digital signature
that your mail program doesn't understand. | 
http://www.subspacefield.org/~travis/ 
If you are a spammer, please email j...@subspacefield.org to get blacklisted.

Attachment: pgpCAmvYfWNJs.pgp
Description: PGP signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to