mirror of
https://github.com/clearml/clearml
synced 2025-02-07 13:23:40 +00:00
Fix JupyterLab notebook detection
This commit is contained in:
parent
cf3c6ba815
commit
5641cb5a7c
@ -276,7 +276,8 @@ class _JupyterObserver(object):
|
|||||||
# noinspection PyPackageRequirements
|
# noinspection PyPackageRequirements
|
||||||
from nbconvert.exporters.script import ScriptExporter
|
from nbconvert.exporters.script import ScriptExporter
|
||||||
_script_exporter = ScriptExporter()
|
_script_exporter = ScriptExporter()
|
||||||
except Exception:
|
except Exception as ex:
|
||||||
|
_logger.warning('Could not read Jupyter Notebook: {}'.format(ex))
|
||||||
return
|
return
|
||||||
# load pigar
|
# load pigar
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
@ -493,7 +494,7 @@ class ScriptInfo(object):
|
|||||||
import ipykernel
|
import ipykernel
|
||||||
from glob import glob
|
from glob import glob
|
||||||
import json
|
import json
|
||||||
for f in glob(os.path.join(os.path.dirname(ipykernel.get_connection_file()), 'nbserver-*.json')):
|
for f in glob(os.path.join(os.path.dirname(ipykernel.get_connection_file()), '??server-*.json')):
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
with open(f, 'r') as json_data:
|
with open(f, 'r') as json_data:
|
||||||
|
Loading…
Reference in New Issue
Block a user