From ff4855b28cb7b227176ab5749dd1db09fe8b5d0c Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Wed, 9 Mar 2022 16:46:13 -0800 Subject: [PATCH] Python 2/3 shim in tests so they pass on python 2 for ipywidgets 7.x --- ipywidgets/widgets/tests/test_interaction.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ipywidgets/widgets/tests/test_interaction.py b/ipywidgets/widgets/tests/test_interaction.py index 19a82bb236..7d44098694 100644 --- a/ipywidgets/widgets/tests/test_interaction.py +++ b/ipywidgets/widgets/tests/test_interaction.py @@ -254,7 +254,12 @@ def test_iterable_tuple(): check_widgets(c, lis=d) def test_mapping(): - from collections.abc import Mapping + try: + # Python 3 + from collections.abc import Mapping + except ImportError: + # Python 2 + from collections import Mapping class TestMapping(Mapping): def __init__(self, values): self.values = values