diff src/if_python3.c @ 8967:df5f9284fcba v7.4.1769

commit https://github.com/vim/vim/commit/6d4431e7b675ba7a0194c0b8eb84b7d92e4e7953 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 21 20:00:56 2016 +0200 patch 7.4.1769 Problem: No "closed", "errors" and "encoding" attribute on Python output. Solution: Add attributes and more tests. (Roland Puntaier, closes https://github.com/vim/vim/issues/622)
author Christian Brabandt <cb@256bit.org>
date Thu, 21 Apr 2016 20:15:05 +0200
parents 8755d57debaa
children 4aead6a9b7a9
line wrap: on
line diff
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -1100,6 +1100,10 @@ OutputGetattro(PyObject *self, PyObject 
 
     if (strcmp(name, "softspace") == 0)
 	return PyLong_FromLong(((OutputObject *)(self))->softspace);
+    else if (strcmp(name, "errors") == 0)
+	return PyString_FromString("strict");
+    else if (strcmp(name, "encoding") == 0)
+	return PyString_FromString(ENC_OPT);
 
     return PyObject_GenericGetAttr(self, nameobj);
 }