Skip to content

Commit bf28ddd

Browse files
authored
BUG: functools.partial objects do not always have a __module__ attr in Python 3.9 (#1233)
1 parent 5928524 commit bf28ddd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backtesting/backtesting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ def plot(self, *, results: pd.Series = None, filename=None, plot_width=None,
17311731

17321732
__all__ = [getattr(v, '__name__', k)
17331733
for k, v in globals().items() # export
1734-
if ((callable(v) and v.__module__ == __name__ or # callables from this module
1734+
if ((callable(v) and getattr(v, '__module__', None) == __name__ or # callables from this module; getattr for Python 3.9; # noqa: E501
17351735
k.isupper()) and # or CONSTANTS
17361736
not getattr(v, '__name__', k).startswith('_'))] # neither marked internal
17371737

0 commit comments

Comments
 (0)