diff --git a/backtesting/lib.py b/backtesting/lib.py index 9079b0ea..8ea89e3e 100644 --- a/backtesting/lib.py +++ b/backtesting/lib.py @@ -617,9 +617,9 @@ def optimize(self, **kwargs) -> pd.DataFrame: # NOTE: Don't put anything below this __all__ list __all__ = [getattr(v, '__name__', k) - for k, v in globals().items() # export - if ((callable(v) and v.__module__ == __name__ or # callables from this module - k.isupper()) and # or CONSTANTS - not getattr(v, '__name__', k).startswith('_'))] # neither marked internal + for k, v in globals().items() # export + if ((callable(v) and getattr(v, '__module__') == __name__ or # callables from this module + k.isupper()) and # or CONSTANTS + not getattr(v, '__name__', k).startswith('_'))] # neither marked internal # NOTE: Don't put anything below here. See above.