diff --git a/benchmarks/benchmark_all_examples.py b/benchmarks/benchmark_all_examples.py
index 676bfe16ba94d53682ff6e52d7b714d8fa1c2d8b..e45537a4dd2dca52482f53f9b865f2302cb660c6 100644
--- a/benchmarks/benchmark_all_examples.py
+++ b/benchmarks/benchmark_all_examples.py
@@ -1,7 +1,6 @@
 import runpy
 import sys
 from io import StringIO
-from test.support import swap_attr
 from time import sleep
 
 import importlib_resources
@@ -9,6 +8,8 @@ import pkg_resources
 from benchmarker import Benchmarker
 from importlib_resources import path
 
+from benchmarks.benchmark_utils import swap_attr
+
 for entry in [entry for entry in importlib_resources.contents('examples') if
               not pkg_resources.resource_isdir('examples', entry)
               and entry.endswith(".py")