diff --git a/audio/beets/Makefile b/audio/beets/Makefile index c6b6fd0961b3..80a110b0c470 100644 --- a/audio/beets/Makefile +++ b/audio/beets/Makefile @@ -2,7 +2,7 @@ PORTNAME= beets PORTVERSION= 1.4.9 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= audio python MASTER_SITES= CHEESESHOP diff --git a/audio/beets/files/patch-beets_util_functemplate.py b/audio/beets/files/patch-beets_util_functemplate.py new file mode 100644 index 000000000000..6948dac76232 --- /dev/null +++ b/audio/beets/files/patch-beets_util_functemplate.py @@ -0,0 +1,39 @@ +--- beets/util/functemplate.py.orig 2021-06-08 14:54:08 UTC ++++ beets/util/functemplate.py +@@ -73,16 +73,26 @@ def ex_literal(val): + """An int, float, long, bool, string, or None literal with the given + value. + """ +- if val is None: +- return ast.Name('None', ast.Load()) +- elif isinstance(val, six.integer_types): +- return ast.Num(val) +- elif isinstance(val, bool): +- return ast.Name(bytes(val), ast.Load()) +- elif isinstance(val, six.string_types): +- return ast.Str(val) +- raise TypeError(u'no literal for {0}'.format(type(val))) +- ++ if sys.version_info[:2] < (3, 4): ++ if val is None: ++ return ast.Name('None', ast.Load()) ++ elif isinstance(val, six.integer_types): ++ return ast.Num(val) ++ elif isinstance(val, bool): ++ return ast.Name(bytes(val), ast.Load()) ++ elif isinstance(val, six.string_types): ++ return ast.Str(val) ++ raise TypeError(u'no literal for {0}'.format(type(val))) ++ elif sys.version_info[:2] < (3, 6): ++ if val in [None, True, False]: ++ return ast.NameConstant(val) ++ elif isinstance(val, six.integer_types): ++ return ast.Num(val) ++ elif isinstance(val, six.string_types): ++ return ast.Str(val) ++ raise TypeError(u'no literal for {0}'.format(type(val))) ++ else: ++ return ast.Constant(val) + + def ex_varassign(name, expr): + """Assign an expression into a single variable. The expression may