summaryrefslogtreecommitdiff
path: root/odoo/tools/misc.py
diff options
context:
space:
mode:
authorxmo-odoo <xmo@odoo.com>2017-04-24 15:19:55 +0200
committerGitHub <noreply@github.com>2017-04-24 15:19:55 +0200
commit90645ad3922c1b20e0e4882a5dee0e254bb6f4e4 (patch)
tree5918da9b18a0c3659f1373dbe3966f4e09a3bdda /odoo/tools/misc.py
parent95702929b185372128c4bfb1d6f09a15b0479dd0 (diff)
[FIX] function introspection attributes
Introspection attributes on function and methods were originally prefixed with func_ or im_ e.g. im_class or func_name. For coherence with the rest of the data model, Python 3 added dunder attributes (__func__, __code__) and removed the old style, the dunder attributes were backported to Python 2.6. Use dunder attributes everywhere we're currently using func_* or im_* attributes. Fixers: lib2to3.fixes.fix_funcattrs lib2to3.fixes.fix_methodattrs #8530
Diffstat (limited to 'odoo/tools/misc.py')
-rw-r--r--odoo/tools/misc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py
index e0456a8429b..ebeb65c3523 100644
--- a/odoo/tools/misc.py
+++ b/odoo/tools/misc.py
@@ -471,7 +471,7 @@ class profile(object):
def wrapper(*args, **kwargs):
profile = cProfile.Profile()
result = profile.runcall(f, *args, **kwargs)
- profile.dump_stats(self.fname or ("%s.cprof" % (f.func_name,)))
+ profile.dump_stats(self.fname or ("%s.cprof" % (f.__name__,)))
return result
return wrapper