Skip to content

Commit a9497bf

Browse files
committed
fixed problem with --help or --get_api from kernel
1 parent a80ba79 commit a9497bf

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
* V1.7.4dev
22
* extended run_and_get_stdout kernel function
33
* fixed problem in run_and_get_stdout (ValueError: I/O operation on closed file)
4+
* fixed problem with --help or --get_api from kernel
45

56
* V1.7.3
67
* fixed rare bug when 'return' is non-integer in remote CK access (such as during crowd-tuning and crowd-testing)

ck/kernel.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,7 @@ def init(i):
20412041
p=py
20422042
break
20432043
elif px!='':
2044-
work['env_root']=px
2044+
work['env_root']=px
20452045

20462046
if p=='':
20472047
return {'return':1, 'error':'Internal CK error (can\'t find default repo) - please report to authors'}
@@ -3265,7 +3265,6 @@ def get_api(i):
32653265
}
32663266
"""
32673267

3268-
32693268
p=i.get('path','')
32703269
f=i.get('func','')
32713270
o=i['out']
@@ -3282,7 +3281,11 @@ def get_api(i):
32823281
p=rx['path']
32833282

32843283
if p=='':
3285-
p=os.path.join(work['env_root'], cfg['file_kernel_py'])
3284+
p1=os.path.dirname(os.path.dirname(work['dir_default_repo']))
3285+
p=os.path.join(p1, cfg['file_kernel_py'])
3286+
3287+
if not os.path.isfile(p):
3288+
return {'return':1, 'error':'kernel not found in '+p}
32863289
else:
32873290
p=os.path.join(p, 'module.py')
32883291

0 commit comments

Comments
 (0)