fix flake8-bugbear finding

Signed-off-by: Bolehu <heyaohua@xfusion.com>
(cherry picked from commit ae719fd7788f168d08e903b0d94e3eca88295f6e)
This commit is contained in:
Bolehu 2023-01-07 00:52:31 +08:00 committed by openeuler-sync-bot
parent f482116b57
commit e411186b28
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From fd4556941d9f3c812b15eab715ccc72a365cf69c Mon Sep 17 00:00:00 2001
From: David Lord <davidism@gmail.com>
Date: Mon, 4 Apr 2022 10:59:19 -0700
Subject: [PATCH] fix flake8-bugbear finding
---
src/werkzeug/debug/repr.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/werkzeug/debug/repr.py b/src/werkzeug/debug/repr.py
index 7d847b03..3cc45d5d 100644
--- a/src/werkzeug/debug/repr.py
+++ b/src/werkzeug/debug/repr.py
@@ -83,8 +83,8 @@ def _add_subclass_info(
inner: str, obj: object, base: t.Union[t.Type, t.Tuple[t.Type, ...]]
) -> str:
if isinstance(base, tuple):
- for base in base:
- if type(obj) is base:
+ for cls in base:
+ if type(obj) is cls:
return inner
elif type(obj) is base:
return inner
--
2.33.0

View File

@ -1,13 +1,14 @@
%global _empty_manifest_terminate_build 0
Name: python-werkzeug
Version: 2.0.3
Release: 2
Release: 3
Summary: The comprehensive WSGI web application library.
License: BSD-3-Clause
URL: https://palletsprojects.com/p/werkzeug/
Source0: https://files.pythonhosted.org/packages/6c/a8/60514fade2318e277453c9588545d0c335ea3ea6440ce5cdabfca7f73117/Werkzeug-2.0.3.tar.gz
Patch0001: backport-fix-typo-and-grammar-mistake.patch
Patch0002: backport-fix-flake8-bugbear-finding.patch
BuildArch: noarch
BuildRequires: python3-werkzeug
@ -177,6 +178,9 @@ export PYTHONPATH=$PYTHONPATH:$depath
%{_docdir}/*
%changelog
* Mon Jan 9 2023 Bolehu <heyaohua@xfusion.com> - 2.0.3-3
- fix flake8-bugbear finding
* Sat Jan 7 2023 Bolehu <heyaohua@xfusion.com> - 2.0.3-2
- fix typo and grammar mistake