We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ea81bf commit 792da5aCopy full SHA for 792da5a
importlib_resources/_common.py
@@ -87,19 +87,13 @@ def _(cand: None) -> types.ModuleType:
87
return resolve(_infer_caller().f_globals['__name__'])
88
89
90
-@functools.lru_cache
91
-def _this_filename():
92
- frame = inspect.currentframe()
93
- return __file__ if frame is None else inspect.getframeinfo(frame).filename
94
-
95
96
def _infer_caller():
97
"""
98
Walk the stack and find the frame of the first caller not in this module.
99
100
101
def is_this_file(frame_info):
102
- return frame_info.filename == _this_filename()
+ return frame_info.filename == __file__.replace('.pyc', '.py')
103
104
def is_wrapper(frame_info):
105
return frame_info.function == 'wrapper'
0 commit comments