@@ -93,42 +93,36 @@ py::object __Finfo__::getLookupValueFinfoItem(const ObjId& oid, const Finfo* f,
9393 string srcType = srcDestType[0 ];
9494 string tgtType = srcDestType[1 ];
9595
96- py::object r;
96+ py::object r = py::none () ;
9797
9898 if (srcType == " string" ) {
9999 auto k = py::cast<string>(key);
100- r = getLookupValueFinfoItemInner<string>(oid, f, k, tgtType);
100+ return getLookupValueFinfoItemInner<string>(oid, f, k, tgtType);
101101 } else if (srcType == " unsigned int" ) {
102102 auto k = py::cast<unsigned int >(key);
103- r = getLookupValueFinfoItemInner<unsigned int >(oid, f, k, tgtType);
103+ return getLookupValueFinfoItemInner<unsigned int >(oid, f, k, tgtType);
104104 } else if (srcType == " ObjId" ) {
105105 auto k = py::cast<ObjId>(key);
106- r = getLookupValueFinfoItemInner<ObjId>(oid, f, k, tgtType);
106+ return getLookupValueFinfoItemInner<ObjId>(oid, f, k, tgtType);
107107 } else if (srcType == " Id" ) {
108108 auto k = py::cast<Id>(key);
109- r = getLookupValueFinfoItemInner<Id>(oid, f, k, tgtType);
109+ return getLookupValueFinfoItemInner<Id>(oid, f, k, tgtType);
110110 } else {
111- r = py::none ();
112- }
113-
114- if (r.is (py::none ())) {
115111 py::print (" getLookupValueFinfoItem::NotImplemented for key:" , key,
116- " srcType:" , srcType, " and tgtType:" , tgtType, " path: " ,
117- oid.path ());
112+ " srcType:" , srcType, " and tgtType:" , tgtType, " path: " ,
113+ oid.path ());
118114 throw runtime_error (" getLookupValueFinfoItem::NotImplemented error" );
119115 }
120116 return r;
121117}
122118
123119py::object __Finfo__::getItem (const py::object& key)
124120{
125- py::print (" Fetching value for" , key, finfoType_);
126121 return func_ (key);
127122}
128123
129124py::object __Finfo__::operator ()(const py::object& key)
130125{
131- py::print (" Calling function with key" , key);
132126 return func_ (key);
133127}
134128
0 commit comments