Skip to content

Commit fa8217a

Browse files
committed
add check that dash was correctly imported and exit with helpful message 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
1 parent cfcbdf5 commit fa8217a

File tree

4 files changed

+3206
-4784
lines changed

4 files changed

+3206
-4784
lines changed

packages/dash-html-components/dash_html_components/__init__.py

+9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1+
from __future__ import print_function as _
2+
13
import os as _os
24
import sys as _sys
5+
36
import dash as _dash
7+
48
from .version import __version__
59

10+
if not hasattr(_dash, 'development'):
11+
print("Dash was not successfully imported. Make sure you don't have a file "
12+
"named \n'dash.py' in your current directory.", file=_sys.stderr)
13+
_sys.exit(1)
14+
615
_current_path = _os.path.dirname(_os.path.abspath(__file__))
716

817
_components = _dash.development.component_loader.load_components(

0 commit comments

Comments
 (0)