diff options
| author | Kenneth Reitz <me@kennethreitz.com> | 2011-03-23 02:02:56 -0400 |
|---|---|---|
| committer | Kenneth Reitz <me@kennethreitz.com> | 2011-03-23 02:02:59 -0400 |
| commit | cddbd78a61871a91d5ef8d3b883cb43cfd145f75 (patch) | |
| tree | c8e1e8835fab321300d78dbbcead603d99f05480 /tablib | |
| parent | b113f49ce6aa4dec565b5c0ee30074a9ecdaf3f4 (diff) | |
| download | tablib-cddbd78a61871a91d5ef8d3b883cb43cfd145f75.tar.gz | |
autoload 3 modules if using 3
Diffstat (limited to 'tablib')
| -rw-r--r-- | tablib/formats/_html.py | 8 | ||||
| -rw-r--r-- | tablib/formats/_yaml.py | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tablib/formats/_html.py b/tablib/formats/_html.py index d3a7459..bfa3b5c 100644 --- a/tablib/formats/_html.py +++ b/tablib/formats/_html.py @@ -3,9 +3,15 @@ """ Tablib - HTML export support. """ +import sys from io import StringIO -from tablib.packages import markup + +if sys.version_info.major > 2: + from tablib.packages import markup3 as markup +else: + from tablib.packages import markup + import tablib BOOK_ENDINGS = 'h3' diff --git a/tablib/formats/_yaml.py b/tablib/formats/_yaml.py index 3f2f8b7..0124c94 100644 --- a/tablib/formats/_yaml.py +++ b/tablib/formats/_yaml.py @@ -3,10 +3,16 @@ """ Tablib - YAML Support. """ +import sys + try: import yaml except ImportError: - import tablib.packages.yaml as yaml + if sys.version_info.major > 2: + import tablib.packages.yaml3 as yaml + else: + import tablib.packages.yaml as yaml + import tablib |
