diff options
| author | Dylan Verheul <dylan@zostera.nl> | 2016-11-30 12:32:47 +0100 |
|---|---|---|
| committer | Dylan Verheul <dylan@zostera.nl> | 2016-11-30 12:32:47 +0100 |
| commit | 91d3299280a57a6780c446c21a506f6259552c0a (patch) | |
| tree | f77b194b7729fb14598f11a3653aac14fbc22059 /tablib | |
| parent | f59abe84be6197e8675bc8d04e65ee7b820f4d52 (diff) | |
| download | tablib-91d3299280a57a6780c446c21a506f6259552c0a.tar.gz | |
Fix date and datetime export to JSON in Python versions with a json package
Python without a json package will use omnijson and fail on date and datetime objects.
Added unit tests.
Diffstat (limited to 'tablib')
| -rw-r--r-- | tablib/formats/_json.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tablib/formats/_json.py b/tablib/formats/_json.py index 777040a..fb66745 100644 --- a/tablib/formats/_json.py +++ b/tablib/formats/_json.py @@ -5,8 +5,10 @@ import tablib -import sys -from tablib.packages import omnijson as json +try: + import json +except ImportError: + from tablib.packages import omnijson as json title = 'json' |
