[Yum-devel] [PATCH 2/3] Add argument 'errorfunc' to _getFile and getPackage.

Nils Philippsen nils at redhat.com
Tue Jan 10 12:57:16 UTC 2012


On Wed, 2012-01-04 at 10:45 -0500, Zdenek Pavlas wrote:
> @@ -906,6 +907,23 @@ Insufficient space in download directory %s
>                  return local
>              misc.unlink_f(local)
>  
> +        if not 'errorfunc' in self._getFile.im_func.func_code.co_varnames:

Rather than doing this and relying on (unguaranteed?) Python innards, we
should use the inspect module which also makes it easier to read (as
well as using "if ... not in ..." instead of "if not ... in ..." ;-):

import inspect
...
         if 'errorfunc' not in inspect.getargspec(self._getFile).args:
...

Nils
-- 
Nils Philippsen      "Those who would give up Essential Liberty to purchase 
Red Hat               a little Temporary Safety, deserve neither Liberty
nils at redhat.com       nor Safety."  --  Benjamin Franklin, 1759
PGP fingerprint:      C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011



More information about the Yum-devel mailing list