use the stricter PyMapping_Check (closes #15801)
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index 5931f3d..a161512 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -1113,6 +1113,9 @@
         self.checkraises(TypeError, '%10.*f', '__mod__', ('foo', 42.))
         self.checkraises(ValueError, '%10', '__mod__', (42,))
 
+        class X(object): pass
+        self.checkraises(TypeError, 'abc', '__mod__', X())
+
     def test_floatformatting(self):
         # float formatting
         for prec in xrange(100):