Commit afee386
Resolve an AttributeError when calling between (#39)
* Resolve an AttributeError on `_datetime`
This seemed to be caused by passing two Pendulum objects created by `pendulum.instance(... datetime ...)` to `pendulum.now().between(...)`. Removing this explicit conversion prevents a double conversion caused by the `__gt__` method, which raised an AttributeError (because, of course, native DT objects, already extracted, will not contain a `_datetime` attribute).
This bug was at least found in pendulum 0.5.4 on python 2.7, my local dev environment for my current project.
* Unit test against Issue #391 parent 075b295 commit afee386
2 files changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1166 | 1166 | | |
1167 | 1167 | | |
1168 | 1168 | | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | 1169 | | |
1173 | 1170 | | |
1174 | 1171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
297 | 307 | | |
298 | 308 | | |
299 | 309 | | |
| |||
0 commit comments