diff --git a/docs/api.rst b/docs/api.rst index db39ad99..917fc627 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -383,6 +383,9 @@ Connection Methods the root PID of a running Docker, LXC, LXD, or systemd-nspawn container. + The setns method depends on the built-in :mod:`ctypes` module, and thus + does not support Python 2.4. + A program is required only to find the root PID, after which management of the child Python interpreter is handled directly. diff --git a/tests/setns_test.py b/tests/setns_test.py index b8a75788..d48179b1 100644 --- a/tests/setns_test.py +++ b/tests/setns_test.py @@ -1,6 +1,7 @@ import os import socket +import sys import mitogen import mitogen.parent @@ -34,5 +35,12 @@ class DockerTest(testlib.DockerMixin, testlib.TestCase): via_setns.call(socket.gethostname), ) + +DockerTest = unittest2.skipIf( + condition=sys.version_info < (2, 5), + reason="mitogen.setns unsupported on Python <2.4" +)(DockerTest) + + if __name__ == '__main__': unittest2.main()