1. Olemis Lang
  2. trac-rpc-dev

Commits

osimons  committed 4663bf1

[svn r7194] XmlRpcPlugin: 0.12dev compat code revisited - use `empty` (constant) instead of `Empty` (class) according to Christian. Closes #6054 again.

  • Participants
  • Parent commits 337b9fa
  • Branches xmlrpcplugin

Comments (0)

Files changed (2)

File trunk/tracrpc/util.py

View file
  • Ignore whitespace
         return message
 
 try:
-    # Type available from Trac 0.12dev r8612
-    from trac.util.text import Empty
+    # Constant available from Trac 0.12dev r8612
+    from trac.util.text import empty
 except ImportError:
-    Empty = type(None)
+    empty = None

File trunk/tracrpc/web_ui.py

View file
  • Ignore whitespace
 
 from tracrpc.api import IXMLRPCHandler, XMLRPCSystem
 from tracrpc.util import from_xmlrpc_datetime, to_xmlrpc_datetime
-from tracrpc.util import exception_to_unicode, Empty
+from tracrpc.util import exception_to_unicode, empty
 
 try:
     try:
         for res in result:
             if isinstance(res, datetime.datetime):
                 new_result.append(to_xmlrpc_datetime(res))
-            elif res == None or isinstance(res, Empty):
+            elif res is None or res is empty:
                 new_result.append('')
             elif isinstance(res, genshi.builder.Fragment) \
                         or isinstance(res, genshi.core.Markup):