Use list for random.sample since using a set has been removed in Python
3.11
This commit is contained in:
parent
72a14b57fc
commit
5329a91648
23
217.patch
Normal file
23
217.patch
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
From 6d0222413f06b4b7ed52a1c2f4774bbe1acbd3be Mon Sep 17 00:00:00 2001
|
||||||
|
From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
|
||||||
|
Date: Wed, 10 Mar 2021 14:15:36 +0000
|
||||||
|
Subject: [PATCH] Use list for random.sample since using a set has been
|
||||||
|
deprecated since Python 3.9
|
||||||
|
|
||||||
|
---
|
||||||
|
jmespath/parser.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/jmespath/parser.py b/jmespath/parser.py
|
||||||
|
index eeac38f..4706688 100644
|
||||||
|
--- a/jmespath/parser.py
|
||||||
|
+++ b/jmespath/parser.py
|
||||||
|
@@ -489,7 +489,7 @@ def _raise_parse_error_maybe_eof(self, expected_type, token):
|
||||||
|
lex_position, actual_value, actual_type, message)
|
||||||
|
|
||||||
|
def _free_cache_entries(self):
|
||||||
|
- for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)):
|
||||||
|
+ for key in random.sample(list(self._CACHE.keys()), int(self._MAX_SIZE / 2)):
|
||||||
|
self._CACHE.pop(key, None)
|
||||||
|
|
||||||
|
@classmethod
|
@ -2,12 +2,15 @@
|
|||||||
|
|
||||||
Name: python-%{pypi_name}
|
Name: python-%{pypi_name}
|
||||||
Version: 0.10.0
|
Version: 0.10.0
|
||||||
Release: 5%{?dist}
|
Release: 6%{?dist}
|
||||||
Summary: JSON Matching Expressions
|
Summary: JSON Matching Expressions
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/jmespath/jmespath.py
|
URL: https://github.com/jmespath/jmespath.py
|
||||||
Source0: %{url}/archive/%{version}/jmespath.py-%{version}.tar.gz
|
Source0: %{url}/archive/%{version}/jmespath.py-%{version}.tar.gz
|
||||||
|
# Use list for random.sample since using a set has been removed in Python 3.11.
|
||||||
|
# This can be removed once upstream PR is merged.
|
||||||
|
Patch217: https://github.com/jmespath/jmespath.py/pull/217.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -35,6 +38,7 @@ a JSON document.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n jmespath.py-%{version}
|
%setup -q -n jmespath.py-%{version}
|
||||||
|
%patch217 -p1
|
||||||
rm -rf %{pypi_name}.egg-info
|
rm -rf %{pypi_name}.egg-info
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -54,6 +58,10 @@ rm -rf %{pypi_name}.egg-info
|
|||||||
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
|
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Mar 15 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 0.10.0-6
|
||||||
|
- Use list for random.sample since using a set has been removed in Python 3.11
|
||||||
|
- Fixes: rhbz#2057520
|
||||||
|
|
||||||
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-5
|
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-5
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user