Skip to content

Commit

Permalink
Stop using deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemessick committed Jan 13, 2025
1 parent 48e9267 commit 1259588
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kaggle/api/kaggle_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ def kernel_push(self, kernel_push_request): # noqa: E501
"""
with tempfile.TemporaryDirectory() as tmpdir:
meta_file = os.path.join(tmpdir, 'kernel-metadata.json')
code_file = tempfile.mktemp('code','py', tmpdir)
with open(code_file, 'w') as c:
c.write(json.dumps(kernel_push_request.code))
(fd,code_file) = tempfile.mkstemp('code','py', tmpdir, text=True)
fd.write(json.dumps(kernel_push_request.code))
os.close(fd)
with open(meta_file, 'w') as f:
params = kernel_push_request.to_dict()
params['code_file'] = code_file
Expand Down

0 comments on commit 1259588

Please sign in to comment.