| 37 | | if not exc.args[0].startswith('No module named management'): |
|---|
| | 37 | # This is slightly hackish. We want to ignore ImportErrors |
|---|
| | 38 | # if the "management" module itself is missing -- but we don't |
|---|
| | 39 | # want to ignore the exception if the management module exists |
|---|
| | 40 | # but raises an ImportError for some reason. The only way we |
|---|
| | 41 | # can do this is to check the text of the exception. Note that |
|---|
| | 42 | # we're a bit broad in how we check the text, because different |
|---|
| | 43 | # Python implementations may not use the same text. CPython |
|---|
| | 44 | # uses the text "No module named management". |
|---|
| | 45 | msg = exc.args[0] |
|---|
| | 46 | if not msg.startswith('No module named management') or 'management' not in msg: |
|---|