Commit d7f8d864 authored by CharlieC's avatar CharlieC
Browse files

Simplify branching logic slightly.

--HG--
branch : 3.0
parent baee8c98aa56
Pipeline #11886 passed with stage
in 2 minutes and 42 seconds
......@@ -183,13 +183,13 @@ class Cell(StyleableObject):
except KeyError:
dt = get_type(t, value)
if dt is not None:
self.data_type = dt
if dt is None and value is not None:
raise ValueError("Cannot convert {0!r} to Excel".format(value))
if dt == 'n' or dt == 'b':
pass
if dt:
self.data_type = dt
elif dt == 'd':
if dt == 'd':
if not is_date_format(self.number_format):
self.number_format = get_time_format(t)
......@@ -200,9 +200,6 @@ class Cell(StyleableObject):
elif value in ERROR_CODES:
self.data_type = 'e'
elif value is not None:
raise ValueError("Cannot convert {0!r} to Excel".format(value))
self._value = value
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment