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

Commit 0d65ea6

Browse files
ned2chriddyp
authored andcommitted
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 c507b4f commit 0d65ea6

File tree

4 files changed

+3206
-4784
lines changed

4 files changed

+3206
-4784
lines changed

dash_html_components/__init__.py

Lines changed: 9 additions & 0 deletions
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)