Home Patches

Patch for Slice2py for self property

nathanbnlnathanbnl Member Nathan DeveloperOrganization: IPerityProject: telephony services
Using 'self' as the name of a property within a Slice struct seems valid, but generates runtime errors when used in Python.

The following simple patch adds 'self' as a keyword in the slice2py compiler:
--- cpp/src/Slice/PythonUtil.cpp	2011-06-15 21:43:59.000000000 +0200
+++ PythonUtil.cpp	2013-01-23 13:26:04.241021454 +0100
@@ -185,7 +185,7 @@
     {
         "None", "and", "assert", "break", "class", "continue", "def", "del", "elif", "else", "except", "exec",
         "finally", "for", "from", "global", "if", "import", "in", "is", "lambda", "not", "or", "pass",
-        "print", "raise", "return", "try", "while", "yield"
+        "print", "raise", "return", "self", "try", "while", "yield"
     };
     bool found =  binary_search(&keywordList[0],
                                 &keywordList[sizeof(keywordList) / sizeof(*keywordList)],

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Thanks, this will be fixed in 3.5.0.

    Mark
Sign In or Register to comment.