mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-04 04:25:38 +08:00
d833503e50
The "use_environment" decorator is too side-effectful (e.g., connecting to Yahoo! Finance or another data source) to be used as a decorator to a function that gets evaluated during module load. This causes problems, e.g., if Zipline is being used in a gevent environment, when the trading environment created by the decorator argument tries to use greenlets when gevent hasn't been fully initialized. Since the decorator is nothing more than a context-manager wrapper, this commit removes the decorator and replaces its use with contexts, i.e., "with" statements.