mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
Don't call sys_info() at import time
This commit is contained in:
parent
8a1ece4577
commit
a051f24e0d
@ -39,7 +39,12 @@ from notebook.services.security import csp_report_uri
|
|||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
non_alphanum = re.compile(r'[^A-Za-z0-9]')
|
non_alphanum = re.compile(r'[^A-Za-z0-9]')
|
||||||
|
|
||||||
sys_info = json.dumps(get_sys_info())
|
_sys_info_cache = None
|
||||||
|
def json_sys_info():
|
||||||
|
global _sys_info_cache
|
||||||
|
if _sys_info_cache is None:
|
||||||
|
_sys_info_cache = json.dumps(get_sys_info())
|
||||||
|
return _sys_info_cache
|
||||||
|
|
||||||
def log():
|
def log():
|
||||||
if Application.initialized():
|
if Application.initialized():
|
||||||
@ -357,7 +362,7 @@ class IPythonHandler(AuthenticatedHandler):
|
|||||||
login_available=self.login_available,
|
login_available=self.login_available,
|
||||||
token_available=bool(self.token or self.one_time_token),
|
token_available=bool(self.token or self.one_time_token),
|
||||||
static_url=self.static_url,
|
static_url=self.static_url,
|
||||||
sys_info=sys_info,
|
sys_info=json_sys_info(),
|
||||||
contents_js_source=self.contents_js_source,
|
contents_js_source=self.contents_js_source,
|
||||||
version_hash=self.version_hash,
|
version_hash=self.version_hash,
|
||||||
ignore_minified_js=self.ignore_minified_js,
|
ignore_minified_js=self.ignore_minified_js,
|
||||||
|
Loading…
Reference in New Issue
Block a user