(self, val)
| 1139 | return int(i), int(f.ljust(6, "0")[:6]) |
| 1140 | |
| 1141 | def _to_decimal(self, val): |
| 1142 | try: |
| 1143 | decimal_value = Decimal(val) |
| 1144 | # See GH 662, edge case, infinite value should not be converted |
| 1145 | # via `_to_decimal` |
| 1146 | if not decimal_value.is_finite(): |
| 1147 | raise ValueError("Converted decimal value is infinite or NaN") |
| 1148 | except Exception as e: |
| 1149 | msg = "Could not convert %s to decimal" % val |
| 1150 | six.raise_from(ValueError(msg), e) |
| 1151 | else: |
| 1152 | return decimal_value |
| 1153 | |
| 1154 | # ------------------------------------------------------------------ |
| 1155 | # Post-Parsing construction of datetime output. These are kept as |
no outgoing calls
no test coverage detected