Skip to content

Commit

Permalink
Fix for use of TradeDB with no TradeEnv
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Dec 12, 2014
1 parent 7fa6cd9 commit cc4443e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ def __init__(self,
self.numLinks = None
self.tradingCount = None

self.tdenv = tdenv or TradeEnv(debug=(debug or 0))
tdenv = tdenv or TradeEnv(debug=(debug or 0))
self.tdenv = tdenv

dataDir = Path(tdenv.dataDir).resolve()
self.dbPath = Path(tdenv.dbFilename or dataDir / TradeDB.defaultDB)
Expand Down
2 changes: 1 addition & 1 deletion tradeenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TradeEnv(object):

def __init__(self, properties=None, **kwargs):
properties = properties or dict()
self.__dict__.update(TradeEnv.defaults)
self.__dict__.update(self.defaults)
if properties:
self.__dict__.update(properties.__dict__)
if kwargs:
Expand Down

0 comments on commit cc4443e

Please sign in to comment.