Skip to content

Commit

Permalink
add check that dash was correctly imported and exit with helpful mess…
Browse files Browse the repository at this point in the history
…age if failed (plotly#39)

* add check that dash was imported and exit with useful message if not

* don't add print_function to namespace

* added test to check for sys.exit(1) when dash.py present
  • Loading branch information
ned2 committed Mar 30, 2018
1 parent 6ee9d8b commit 9e17d23
Show file tree
Hide file tree
Showing 4 changed files with 3,206 additions and 4,784 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
from __future__ import print_function as _

import os as _os
import sys as _sys

import dash as _dash

from .version import __version__

if not hasattr(_dash, 'development'):
print("Dash was not successfully imported. Make sure you don't have a file "
"named \n'dash.py' in your current directory.", file=_sys.stderr)
_sys.exit(1)

_current_path = _os.path.dirname(_os.path.abspath(__file__))

_components = _dash.development.component_loader.load_components(
Expand Down
Loading

0 comments on commit 9e17d23

Please sign in to comment.