Skip to content

Commit

Permalink
Allow setting cell name
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Apr 27, 2021
1 parent 3d488c7 commit 779c220
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 779c220

Please sign in to comment.