Skip to content

Commit

Permalink
Merge pull request #652 from davidbrochart/cell_name
Browse files Browse the repository at this point in the history
Allow setting cell name
  • Loading branch information
blink1073 authored Apr 27, 2021
2 parents 3d488c7 + 779c220 commit b83a08c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ipykernel/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ def get_tmp_hash_seed():
return hash_seed

def get_file_name(code):
name = murmur2_x86(code, get_tmp_hash_seed())
return get_tmp_directory() + '/' + str(name) + '.py'
cell_name = os.environ.get("IPYKERNEL_CELL_NAME")
if cell_name is None:
name = murmur2_x86(code, get_tmp_hash_seed())
cell_name = get_tmp_directory() + '/' + str(name) + '.py'
return cell_name

class XCachingCompiler(CachingCompiler):

Expand Down

0 comments on commit b83a08c

Please sign in to comment.