]> granicus.if.org Git - python/commitdiff
allow the test suite to pass if the strop module doesn't exist (GH-5566)
authorBenjamin Peterson <benjamin@python.org>
Tue, 6 Feb 2018 17:29:21 +0000 (09:29 -0800)
committerGitHub <noreply@github.com>
Tue, 6 Feb 2018 17:29:21 +0000 (09:29 -0800)
strop is highly legacy and can be safely compiled out in most installations. Let's not fail the test suite for its absence.

Lib/test/test_strop.py

index 81d078ed8d39c6e1ad3bcbd6b875a0817d9773ed..50b8f6ebc3d8f7ef98ee9c8a4b141bc12e1a6f9e 100644 (file)
@@ -2,11 +2,12 @@ import warnings
 warnings.filterwarnings("ignore", "strop functions are obsolete;",
                         DeprecationWarning,
                         r'test.test_strop|unittest')
-import strop
 import unittest
 import sys
 from test import test_support
 
+strop = test_support.import_module("strop")
+
 
 class StropFunctionTestCase(unittest.TestCase):