Change in vdsm[master]: logUtils.funcName: work on partial methods
asegurap at redhat.com
asegurap at redhat.com
Wed Jan 23 12:58:55 UTC 2013
Antoni Segura Puimedon has posted comments on this change.
Change subject: logUtils.funcName: work on partial methods
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(1 inline comment)
Maybe it's just me, but I get different behavior.
....................................................
File vdsm/logUtils.py
Line 24: from inspect import ismethod
Line 25:
Line 26:
Line 27: def funcName(func):
Line 28: if hasattr(func, 'im_func'):
I tried with rhel64 and with F18 and for this test code
from functools import partial
def foo(bar)
print bar
moo = partial(foo, 'moo')
hasattr(moo, 'im_func')
I get False
but
hasattr(moo, 'func')
gets me True
and moo.func.func_name gives me 'foo'
Line 29: return func.im_func.func_name
Line 30:
Line 31: return func.func_name
Line 32:
--
To view, visit http://gerrit.ovirt.org/11305
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I59ce729edadc57b5df4eee8860d96367d9ed8253
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list