diff --git a/catalyst/curate/poloniex.py b/catalyst/curate/poloniex.py index 824b5e58..c67e03bc 100644 --- a/catalyst/curate/poloniex.py +++ b/catalyst/curate/poloniex.py @@ -193,7 +193,8 @@ class PoloniexCurator(object): for this currencyPair ''' try: - if('end_file' in locals() and end_file + 3600 < end): + if(temp is not None + or ('end_file' in locals() and end_file + 3600 < end)): if (temp is None): temp = os.tmpfile() tempcsv = csv.writer(temp)