diff -r c0224cfe92f4 django/core/management/commands/loaddata.py
a
|
b
|
|
3 | 3 | from optparse import make_option |
4 | 4 | import sys |
5 | 5 | import os |
6 | | import bz2, gzip, zipfile |
| 6 | import gzip, zipfile |
| 7 | |
| 8 | try: |
| 9 | import bz2 |
| 10 | except ImportError: |
| 11 | bz2 = None |
7 | 12 | |
8 | 13 | try: |
9 | 14 | set |
… |
… |
|
62 | 67 | |
63 | 68 | compression_types = { |
64 | 69 | None: file, |
65 | | 'bz2': bz2.BZ2File, |
66 | 70 | 'gz': gzip.GzipFile, |
67 | 71 | 'zip': SingleZipReader |
68 | 72 | } |
| 73 | if bz2 is not None: |
| 74 | compression_types['bz2'] = bz2.BZ2File |
69 | 75 | |
70 | 76 | app_fixtures = [os.path.join(os.path.dirname(app.__file__), 'fixtures') for app in get_apps()] |
71 | 77 | for fixture_label in fixture_labels: |