mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-20 01:35:13 +03:00
103 lines
3 KiB
Diff
103 lines
3 KiB
Diff
Patch-Source: https://github.com/containers/podman-py/pull/154
|
|
|
|
From 3de1796a9acb9864ff0f79fac63edb74e8b94242 Mon Sep 17 00:00:00 2001
|
|
From: "Jonathan G. Underwood" <jonathan.underwood@gmail.com>
|
|
Date: Sat, 25 Dec 2021 13:07:01 +0000
|
|
Subject: [PATCH] Import Iterator/Iterable from collections.abc for Python >=
|
|
3.10
|
|
|
|
---
|
|
podman/tests/integration/test_containers.py | 7 ++++++-
|
|
podman/tests/unit/test_build.py | 7 ++++++-
|
|
podman/tests/unit/test_container.py | 7 ++++++-
|
|
podman/tests/unit/test_containersmanager.py | 7 ++++++-
|
|
podman/tests/unit/test_imagesmanager.py | 7 ++++++-
|
|
5 files changed, 30 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/podman/tests/integration/test_containers.py b/podman/tests/integration/test_containers.py
|
|
index 1283735..b8f9955 100644
|
|
--- a/podman/tests/integration/test_containers.py
|
|
+++ b/podman/tests/integration/test_containers.py
|
|
@@ -2,7 +2,12 @@
|
|
import random
|
|
import tarfile
|
|
import unittest
|
|
-from collections import Iterator
|
|
+try:
|
|
+ # Python >= 3.10
|
|
+ from collections.abc import Iterator
|
|
+except:
|
|
+ # Python < 3.10
|
|
+ from collections import Iterator
|
|
|
|
import podman.tests.integration.base as base
|
|
from podman import PodmanClient
|
|
diff --git a/podman/tests/unit/test_build.py b/podman/tests/unit/test_build.py
|
|
index 96f8f52..d4c26bc 100644
|
|
--- a/podman/tests/unit/test_build.py
|
|
+++ b/podman/tests/unit/test_build.py
|
|
@@ -1,7 +1,12 @@
|
|
import io
|
|
import json
|
|
import unittest
|
|
-from collections import Iterable
|
|
+try:
|
|
+ # Python >= 3.10
|
|
+ from collections.abc import Iterable
|
|
+except:
|
|
+ # Python < 3.10
|
|
+ from collections import Iterable
|
|
from unittest.mock import patch
|
|
|
|
import requests_mock
|
|
diff --git a/podman/tests/unit/test_container.py b/podman/tests/unit/test_container.py
|
|
index d114853..8521777 100644
|
|
--- a/podman/tests/unit/test_container.py
|
|
+++ b/podman/tests/unit/test_container.py
|
|
@@ -2,7 +2,12 @@
|
|
import io
|
|
import json
|
|
import unittest
|
|
-from collections import Iterable
|
|
+try:
|
|
+ # Python >= 3.10
|
|
+ from collections.abc import Iterable
|
|
+except:
|
|
+ # Python < 3.10
|
|
+ from collections import Iterable
|
|
|
|
import requests_mock
|
|
|
|
diff --git a/podman/tests/unit/test_containersmanager.py b/podman/tests/unit/test_containersmanager.py
|
|
index 71ad093..4932823 100644
|
|
--- a/podman/tests/unit/test_containersmanager.py
|
|
+++ b/podman/tests/unit/test_containersmanager.py
|
|
@@ -1,5 +1,10 @@
|
|
import unittest
|
|
-from collections import Iterator
|
|
+try:
|
|
+ # Python >= 3.10
|
|
+ from collections.abc import Iterator
|
|
+except:
|
|
+ # Python < 3.10
|
|
+ from collections import Iterator
|
|
from unittest.mock import patch, DEFAULT
|
|
|
|
import requests_mock
|
|
diff --git a/podman/tests/unit/test_imagesmanager.py b/podman/tests/unit/test_imagesmanager.py
|
|
index 2398b6a..eca629a 100644
|
|
--- a/podman/tests/unit/test_imagesmanager.py
|
|
+++ b/podman/tests/unit/test_imagesmanager.py
|
|
@@ -1,6 +1,11 @@
|
|
import types
|
|
import unittest
|
|
-from collections import Iterable
|
|
+try:
|
|
+ # Python >= 3.10
|
|
+ from collections.abc import Iterable
|
|
+except:
|
|
+ # Python < 3.10
|
|
+ from collections import Iterable
|
|
|
|
import requests_mock
|
|
|