@@ -216,24 +216,27 @@ def _filter_magics(self, code):
216
216
217
217
# Supported by using Jupyter
218
218
def _find_local_header (self ):
219
- path = path .abspath (path .dirname (__file__ ))
219
+
220
+ import sys
221
+ from os .path import abspath , dirname , exists , join , split
222
+
223
+ path = abspath (dirname (__file__ ))
220
224
starting_points = [path ]
221
225
if not path .startswith (sys .prefix ):
222
226
starting_points .append (sys .prefix )
223
227
for path in starting_points :
224
228
while path != '/' :
225
- share_jupyterhub = path . join (path , 'share' , 'cpp_header' )
226
- if all (path . exists (path . join (share_jupyterhub , f )) for f in ['check_cpp.hpp' ]):
229
+ share_jupyterhub = join (path , 'share' , 'cpp_header' )
230
+ if all (exists (join (share_jupyterhub , f )) for f in ['check_cpp.hpp' ]):
227
231
return share_jupyterhub
228
- path , _ = path . split (path )
232
+ path , _ = split (path )
229
233
# didn't find it, give up
230
234
return ''
231
235
232
236
def _support_external_header (self , code ):
233
237
DATA_FILES_PATH = self ._find_local_header ()
234
- code = ""
235
238
for file in os .listdir (DATA_FILES_PATH ):
236
- path_to_header = os . path . join ( DATA_FILES_PATH , file )
239
+ path_to_header = DATA_FILES_PATH + "/" + file
237
240
if os .path .isdir (path_to_header ):
238
241
pass
239
242
elif os .path .isfile (path_to_header ):
0 commit comments