Issue #6697: Fixed instances of _PyUnicode_AsString() result not checked for NULL
diff --git a/Lib/test/test_syslog.py b/Lib/test/test_syslog.py
index 028dcb4..4e7621e 100644
--- a/Lib/test/test_syslog.py
+++ b/Lib/test/test_syslog.py
@@ -11,6 +11,8 @@
 
     def test_openlog(self):
         syslog.openlog('python')
+        # Issue #6697.
+        self.assertRaises(UnicodeEncodeError, syslog.openlog, '\uD800')
 
     def test_syslog(self):
         syslog.openlog('python')