Skip to content

Commit

Permalink
fix3
Browse files Browse the repository at this point in the history
  • Loading branch information
meold committed Jun 6, 2018
1 parent 393628e commit 388ab18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/ccxt/base/exchange.py
Expand Up @@ -714,8 +714,6 @@ def parse_date(timestamp=None):
def parse8601(timestamp=None):
if timestamp is None:
return timestamp
if not isinstance(timestamp, str):
return None
yyyy = '([0-9]{4})-?'
mm = '([0-9]{2})-?'
dd = '([0-9]{2})(?:T|[\\s])?'
Expand All @@ -727,6 +725,8 @@ def parse8601(timestamp=None):
regex = r'' + yyyy + mm + dd + h + m + s + ms + tz
try:
match = re.search(regex, timestamp, re.IGNORECASE)
if match is None:
return None
yyyy, mm, dd, h, m, s, ms, sign, hours, minutes = match.groups()
ms = ms or '.000'
msint = int(ms[1:])
Expand All @@ -739,7 +739,7 @@ def parse8601(timestamp=None):
dt = datetime.datetime.strptime(string, "%Y%m%d%H%M%S.%fZ")
dt = dt + offset
return calendar.timegm(dt.utctimetuple()) * 1000 + msint
except (TypeError, OverflowError, OSError, ValueError, AttributeError):
except (TypeError, OverflowError, OSError, ValueError):
return None

@staticmethod
Expand Down

0 comments on commit 388ab18

Please sign in to comment.