Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

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 (#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 authored and chriddyp committed Mar 30, 2018
1 parent c507b4f commit 0d65ea6
Show file tree
Hide file tree
Showing 4 changed files with 3,206 additions and 4,784 deletions.
9 changes: 9 additions & 0 deletions dash_html_components/__init__.py
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 0d65ea6

Please sign in to comment.