From 9e4bd31010ece35175579b91dd81d0098125065f Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 1 Nov 2019 17:53:31 +0100 Subject: [PATCH] Fixed issue #386 by mapping 'None' to 'None_' in Python --- src/pya/pya/pyaModule.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index c89219c76..cf71612ca 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -451,7 +451,8 @@ static bool is_reserved_word (const std::string &name) name == "def" || name == "for" || name == "lambda" || - name == "try"); + name == "try" || + name == "None"); } /** @@ -2641,7 +2642,7 @@ PythonModule::make_classes (const char *mod_name) } if (name != raw_name) { - add_python_doc (**c, mt, int (mid), tl::sprintf (tl::to_string (tr ("This method is available as method '%s' in Python")), name)); + add_python_doc (**c, mt, int (mid), tl::sprintf (tl::to_string (tr ("This attribute is available as '%s' in Python")), name)); } // create documentation @@ -2741,7 +2742,7 @@ PythonModule::make_classes (const char *mod_name) } else if (tl::verbosity () >= 20) { tl::warn << "Upper case method name encountered which cannot be used as a Python constant (more than one overload or at least one argument): " << (*c)->name () << "." << name; - add_python_doc (**c, mt, int (mid), tl::to_string (tr ("This method is not available for Python"))); + add_python_doc (**c, mt, int (mid), tl::to_string (tr ("This attribute is not available for Python"))); } } else {