Omnibus commited on
Commit
2546ed8
·
1 Parent(s): 9d52a5f

Update mychain.py

Browse files
Files changed (1) hide show
  1. mychain.py +3 -3
mychain.py CHANGED
@@ -182,17 +182,17 @@ class MyChainRec:
182
  self.pending_transactions = []
183
  self.chain.append(block)
184
  json_object = json.dumps(self.chain, indent=4)
185
- with open("tmp.json", "w") as outfile:
186
  outfile.write(json_object)
187
  try:
188
  api.upload_file(
189
- path_or_fileobj="tmp.json",
190
  path_in_repo=chain_n,
191
  repo_id=chain_r,
192
  token=token_self,
193
  repo_type="dataset",
194
  )
195
- os.remove("tmp.json")
196
 
197
  except Exception as e:
198
  print(e)
 
182
  self.pending_transactions = []
183
  self.chain.append(block)
184
  json_object = json.dumps(self.chain, indent=4)
185
+ with open("tmp1.json", "w") as outfile:
186
  outfile.write(json_object)
187
  try:
188
  api.upload_file(
189
+ path_or_fileobj="tmp1.json",
190
  path_in_repo=chain_n,
191
  repo_id=chain_r,
192
  token=token_self,
193
  repo_type="dataset",
194
  )
195
+ os.remove("tmp1.json")
196
 
197
  except Exception as e:
198
  print(e)