From eb890d98739196b83f1ecb5cb7bcfe9739a9502c Mon Sep 17 00:00:00 2001 From: Michele Simionato Date: Fri, 27 Jul 2018 12:55:36 +0200 Subject: Added the path to the decorator module in the virtual file path --- setup.py | 2 +- src/decorator.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 5890f4b..2f07200 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -dic = {} +dic = dict(__file__=None) exec(open('src/decorator.py').read(), dic) VERSION = dic['__version__'] diff --git a/src/decorator.py b/src/decorator.py index 44303ee..dceca03 100644 --- a/src/decorator.py +++ b/src/decorator.py @@ -173,7 +173,8 @@ class FunctionMaker(object): # Ensure each generated function has a unique filename for profilers # (such as cProfile) that depend on the tuple of (, # , ) being unique. - filename = '' % (next(self._compile_count),) + filename = '<%s:decorator-gen-%d>' % ( + __file__, next(self._compile_count)) try: code = compile(src, filename, 'single') exec(code, evaldict) -- cgit v1.2.1