Skip to content

Commit

Permalink
[EN-1414] fix extra logs in pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
iamishalkin committed May 20, 2020
1 parent 4ada855 commit 0e269a0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dxfeed/core/DXFeedPy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def dxf_create_subscription(ConnectionClass cc, event_type: str, candle_time: Op
candle_time = datetime.strptime(candle_time, '%Y-%m-%d %H:%M:%S') if candle_time else datetime.utcnow()
timestamp = int((candle_time - datetime(1970, 1, 1)).total_seconds()) * 1000 - 5000
except ValueError:
raise Exception("Inapropriate date format, should be %Y-%m-%d %H:%M:%S")
raise Exception("Inappropriate date format, should be %Y-%m-%d %H:%M:%S")

if event_type == 'Candle':
clib.dxf_create_subscription_timed(sc.connection, et_type_int, timestamp, &sc.subscription)
Expand Down Expand Up @@ -370,11 +370,11 @@ def dxf_close_connection(ConnectionClass cc):
cc: ConnectionClass
Variable with connection information
"""
related_subs = cc.get_sub_refs()
for sub in related_subs:
dxf_close_subscription(sub)

if cc.connection:
related_subs = cc.get_sub_refs()
for sub in related_subs:
dxf_close_subscription(sub)

clib.dxf_close_connection(cc.connection)
cc.connection = NULL

Expand Down

0 comments on commit 0e269a0

Please sign in to comment.