[Yum-devel] [PATCH] in python 3k (and in the new rpm-python bindings) rpm is returning flags as LONGS not INTS - so this code breaks w/o this fix.

Tim Lauridsen tim.lauridsen at googlemail.com
Tue Jun 1 17:30:43 UTC 2010


On Tue, Jun 1, 2010 at 7:13 PM, Seth Vidal <skvidal at fedoraproject.org>wrote:

> most importantly it breaks mock
> ---
>  rpmUtils/miscutils.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/rpmUtils/miscutils.py b/rpmUtils/miscutils.py
> index 8e46541..b1631ae 100644
> --- a/rpmUtils/miscutils.py
> +++ b/rpmUtils/miscutils.py
> @@ -351,7 +351,7 @@ def formatRequire (name, version, flags):
>     '''
>     s = name
>
> -    if flags and type(flags) == type(0): # Flag must be set and a int
> +    if flags and (type(flags) == type(0) or type(flags) == type(0L)): #
> Flag must be set and a int (or a long, now)
>         if flags & (rpm.RPMSENSE_LESS | rpm.RPMSENSE_GREATER |
>                     rpm.RPMSENSE_EQUAL):
>             s = s + " "
> --
> 1.7.0.1
>
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum-devel
>


what about

if flags and (isinstance(flags,int ) or isinstance(flags,long): #

more readable, but no problems with your version :)

ACK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20100601/1cc4d423/attachment-0001.html>


More information about the Yum-devel mailing list