diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py
index b900ad73ffc1a19c0d3d9a2d4b1fd58a60b77f25..6c223990cadc5f71b68cd30c28b96544576ed7d6 100755
--- a/indra/llcorehttp/tests/test_llcorehttp_peer.py
+++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py
@@ -306,7 +306,7 @@ def handle_error(self, request, client_address):
     # command-line parsing -- and anyway, for C++ integration tests, that's
     # performed in TUT code rather than our own.
     os.environ["LL_TEST_PORT"] = str(httpd.server_port)
-    debug("$LL_TEST_PORT = %s", port)
+    debug("$LL_TEST_PORT = %s", httpd.server_port)
     if do_valgrind:
         args = ["valgrind", "--log-file=./valgrind.log"] + args
         path_search = True
diff --git a/indra/llmessage/tests/test_llsdmessage_peer.py b/indra/llmessage/tests/test_llsdmessage_peer.py
index a0d5d1b3549afe5d7c84d0fec15b0ac3d3fb99eb..8e1204fb20c607f49bd0dbf45563d6f4ff8f626a 100755
--- a/indra/llmessage/tests/test_llsdmessage_peer.py
+++ b/indra/llmessage/tests/test_llsdmessage_peer.py
@@ -163,5 +163,5 @@ class Server(HTTPServer):
     # command-line parsing -- and anyway, for C++ integration tests, that's
     # performed in TUT code rather than our own.
     os.environ["PORT"] = str(httpd.server_port)
-    debug("$PORT = %s", port)
+    debug("$PORT = %s", httpd.server_port)
     sys.exit(run(server_inst=httpd, *sys.argv[1:]))