diff --git a/backtesting/backtesting.py b/backtesting/backtesting.py index 8e835082..9beb93f3 100644 --- a/backtesting/backtesting.py +++ b/backtesting/backtesting.py @@ -1735,7 +1735,7 @@ def plot(self, *, results: pd.Series = None, filename=None, plot_width=None, __all__ = [getattr(v, '__name__', k) for k, v in globals().items() # export - if ((callable(v) and v.__module__ == __name__ or # callables from this module + if ((callable(v) and getattr(v, '__module__', None) == __name__ or # callables from this module; getattr for Python 3.9; # noqa: E501 k.isupper()) and # or CONSTANTS not getattr(v, '__name__', k).startswith('_'))] # neither marked internal