[git-buildpackage] TypeError on Python < 3.10

Guido Günther agx at sigxcpu.org
Sun Dec 4 12:52:57 CET 2022


Hi Lukasz,
On Sat, Jun 11, 2022 at 04:06:26AM +0200, Łukasz Maszczyński wrote:
> Hi,
> 
> recent changes in gbp, namely this commit:
> 9ab4a0e71438dd39a2b6f1da04ab61810e05c521
> 
> introduces an implicit dependency on Python 3.10 by using PEP 604. This
> makes it impossible to use the most recent 'gbp' package version in
> environments, where older version of Python is installed, e.g. Debian
> Bullseye (stable).
> 
> I attach a patch file that fixes the problem for me.

This mail got stuck in moderaton. We've fixed that with a similar patch
a while back. I hope if works for you now?
Cheers,
 -- Guido

> 
> -- 
> cheers,
> Łukasz

> diff --git a/gbp/pkg/pkgpolicy.py b/gbp/pkg/pkgpolicy.py
> index c5427eeb..2ea8048d 100644
> --- a/gbp/pkg/pkgpolicy.py
> +++ b/gbp/pkg/pkgpolicy.py
> @@ -33,10 +33,10 @@ class PkgPolicy(object):
>                           r'%(?P<M>[^%])'
>                           r'%(?P<R>([^%]|\\%))+'
>                           r'\)s')
> -    packagename_re: typing.Pattern[str] | None = None
> -    packagename_msg: str | None = None
> -    upstreamversion_re: typing.Pattern[str] | None = None
> -    upstreamversion_msg: str | None = None
> +    packagename_re: typing.Union[typing.Pattern[str], None] = None
> +    packagename_msg: typing.Union[str, None] = None
> +    upstreamversion_re: typing.Union[typing.Pattern[str], None] = None
> +    upstreamversion_msg: typing.Union[str, None] = None
>  
>      @classmethod
>      def is_valid_packagename(cls, name):

> _______________________________________________
> git-buildpackage mailing list
> git-buildpackage at lists.sigxcpu.org
> http://lists.sigxcpu.org/mailman/listinfo/git-buildpackage



More information about the git-buildpackage mailing list