public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Felix Schwarz <fschwarz@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/python-genshi] rawhide: rename patch file
Date: Tue, 02 Jun 2026 06:05:19 GMT [thread overview]
Message-ID: <178038031998.1.8632209436010403379.rpms-python-genshi-eae77e4f1274@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/python-genshi
Branch : rawhide
Commit : eae77e4f1274dd337bcb7e6661141a741153e39a
Author : Felix Schwarz <fschwarz@fedoraproject.org>
Date : 2026-06-02T08:04:20+02:00
Stats : +70/-70 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/python-genshi/c/eae77e4f1274dd337bcb7e6661141a741153e39a?branch=rawhide
Log:
rename patch file
---
diff --git a/93.patch b/93.patch
deleted file mode 100644
index 905c31b..0000000
--- a/93.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-diff --git a/genshi/template/astutil.py b/genshi/template/astutil.py
-index c841aeb..0418964 100644
---- a/genshi/template/astutil.py
-+++ b/genshi/template/astutil.py
-@@ -802,7 +802,7 @@ class ASTTransformer(object):
- return visitor(node)
-
- def _clone(self, node):
-- clone = node.__class__()
-+ clone = construct_ast_class(node.__class__)
- for name in getattr(clone, '_attributes', ()):
- try:
- setattr(clone, name, getattr(node, name))
-@@ -887,3 +887,18 @@ class ASTTransformer(object):
- visit_Index = _clone
-
- del _clone
-+
-+
-+def construct_ast_class(cls):
-+ kwargs = {}
-+ if hasattr(cls, '__annotations__'):
-+ for name, typ in cls.__annotations__.items():
-+ if typ is str:
-+ kwargs[name] = 'foo'
-+ elif typ is int:
-+ kwargs[name] = 42
-+ elif typ is object:
-+ kwargs[name] = b'foo'
-+ elif isinstance(typ, type) and issubclass(typ, _ast.AST):
-+ kwargs[name] = construct_ast_class(typ)
-+ return cls(**kwargs)
-diff --git a/genshi/template/eval.py b/genshi/template/eval.py
-index 82bddf3..0f45ab6 100644
---- a/genshi/template/eval.py
-+++ b/genshi/template/eval.py
-@@ -18,7 +18,8 @@ from types import CodeType
-
- from genshi.compat import builtins, exec_, string_types, text_type
- from genshi.core import Markup
--from genshi.template.astutil import ASTTransformer, ASTCodeGenerator, parse
-+from genshi.template.astutil import (
-+ ASTTransformer, ASTCodeGenerator, parse, construct_ast_class)
- from genshi.template.base import TemplateRuntimeError
- from genshi.util import flatten
-
-@@ -59,11 +60,9 @@ class Code(object):
- 'Expected string or AST node, but got %r' % source
- self.source = '?'
- if self.mode == 'eval':
-- node = _ast.Expression()
-- node.body = source
-+ node = _ast.Expression(body=source)
- else:
-- node = _ast.Module()
-- node.body = [source]
-+ node = _ast.Module(body=[source])
-
- self.ast = node
- self.code = _compile(node, self.source, mode=self.mode,
-@@ -454,7 +453,7 @@ def _compile(node, source=None, mode='eval', filename=None, lineno=-1,
-
-
- def _new(class_, *args, **kwargs):
-- ret = class_()
-+ ret = construct_ast_class(class_)
- for attr, value in zip(ret._fields, args):
- if attr in kwargs:
- raise ValueError('Field set both in args and kwargs')
diff --git a/python-genshi-python315.patch b/python-genshi-python315.patch
new file mode 100644
index 0000000..905c31b
--- /dev/null
+++ b/python-genshi-python315.patch
@@ -0,0 +1,69 @@
+diff --git a/genshi/template/astutil.py b/genshi/template/astutil.py
+index c841aeb..0418964 100644
+--- a/genshi/template/astutil.py
++++ b/genshi/template/astutil.py
+@@ -802,7 +802,7 @@ class ASTTransformer(object):
+ return visitor(node)
+
+ def _clone(self, node):
+- clone = node.__class__()
++ clone = construct_ast_class(node.__class__)
+ for name in getattr(clone, '_attributes', ()):
+ try:
+ setattr(clone, name, getattr(node, name))
+@@ -887,3 +887,18 @@ class ASTTransformer(object):
+ visit_Index = _clone
+
+ del _clone
++
++
++def construct_ast_class(cls):
++ kwargs = {}
++ if hasattr(cls, '__annotations__'):
++ for name, typ in cls.__annotations__.items():
++ if typ is str:
++ kwargs[name] = 'foo'
++ elif typ is int:
++ kwargs[name] = 42
++ elif typ is object:
++ kwargs[name] = b'foo'
++ elif isinstance(typ, type) and issubclass(typ, _ast.AST):
++ kwargs[name] = construct_ast_class(typ)
++ return cls(**kwargs)
+diff --git a/genshi/template/eval.py b/genshi/template/eval.py
+index 82bddf3..0f45ab6 100644
+--- a/genshi/template/eval.py
++++ b/genshi/template/eval.py
+@@ -18,7 +18,8 @@ from types import CodeType
+
+ from genshi.compat import builtins, exec_, string_types, text_type
+ from genshi.core import Markup
+-from genshi.template.astutil import ASTTransformer, ASTCodeGenerator, parse
++from genshi.template.astutil import (
++ ASTTransformer, ASTCodeGenerator, parse, construct_ast_class)
+ from genshi.template.base import TemplateRuntimeError
+ from genshi.util import flatten
+
+@@ -59,11 +60,9 @@ class Code(object):
+ 'Expected string or AST node, but got %r' % source
+ self.source = '?'
+ if self.mode == 'eval':
+- node = _ast.Expression()
+- node.body = source
++ node = _ast.Expression(body=source)
+ else:
+- node = _ast.Module()
+- node.body = [source]
++ node = _ast.Module(body=[source])
+
+ self.ast = node
+ self.code = _compile(node, self.source, mode=self.mode,
+@@ -454,7 +453,7 @@ def _compile(node, source=None, mode='eval', filename=None, lineno=-1,
+
+
+ def _new(class_, *args, **kwargs):
+- ret = class_()
++ ret = construct_ast_class(class_)
+ for attr, value in zip(ret._fields, args):
+ if attr in kwargs:
+ raise ValueError('Field set both in args and kwargs')
diff --git a/python-genshi.spec b/python-genshi.spec
index a6eb429..a1e2319 100644
--- a/python-genshi.spec
+++ b/python-genshi.spec
@@ -8,7 +8,7 @@ URL: https://genshi.edgewall.org/
Source0: %{pypi_source genshi}
# https://github.com/edgewall/genshi/pull/93
-Patch: 93.patch
+Patch: python-genshi-python315.patch
BuildRequires: gcc
BuildRequires: python3-devel
reply other threads:[~2026-06-02 6:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178038031998.1.8632209436010403379.rpms-python-genshi-eae77e4f1274@fedoraproject.org \
--to=fschwarz@fedoraproject.org \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox