• Kazuhiko Shiozaki's avatar
    py2/py3: return None in ZSQLBrain._aq_dynamic() if getObject() because of missing path. · 20986cf8
    Kazuhiko Shiozaki authored
    in Python 2, _aq_dynamic() returns None without try..except but it raises ValueError in Python 3.
    
    (python 2)
    > /SR/parts/erp5/product/ZSQLCatalog/Extensions/zsqlbrain.py(31)_aq_dynamic()
     31  ->   def _aq_dynamic(self, name):
     32         """Acquire an attribute from a real object.
     33         """
     34         if name.startswith('__') :
     35           return None
     36         return getattr(self.getObject(), name, None)
    ((Pdb)) getattr(self.getObject(), name, None)
    *** ValueError: Unable to getObject from ZSQLBrain if ZSQL Method does not retrieve the `path` column from catalog table.
    ((Pdb)) r
    --Return--
    > /SR/parts/erp5/product/ZSQLCatalog/Extensions/zsqlbrain.py(36)_aq_dynamic()->None # <-- !!!
    20986cf8
zsqlbrain.py 6.14 KB