diff --git a/Lib3/bsddb/test/test_replication.py b/Lib3/bsddb/test/test_replication.py
index 2fd6aa0..9d78241 100644
--- a/Lib3/bsddb/test/test_replication.py
+++ b/Lib3/bsddb/test/test_replication.py
@@ -105,8 +105,12 @@ class DBReplication(unittest.TestCase) :
 
 class DBReplicationManager(DBReplication) :
     def test01_basic_replication(self) :
-        master_port = test_support.find_unused_port()
-        client_port = test_support.find_unused_port()
+        try:
+            from test.support.socket_helper import find_unused_port
+        except ImportError:
+            find_unused_port = test_support.find_unused_port
+        master_port = find_unused_port()
+        client_port = find_unused_port()
         if db.version() >= (5, 2) :
             self.site = self.dbenvMaster.repmgr_site("127.0.0.1", master_port)
             self.site.set_config(db.DB_GROUP_CREATOR, True)
