Spaces:
Runtime error
Runtime error
Update mychain.py
Browse files- 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("
|
| 186 |
outfile.write(json_object)
|
| 187 |
try:
|
| 188 |
api.upload_file(
|
| 189 |
-
path_or_fileobj="
|
| 190 |
path_in_repo=chain_n,
|
| 191 |
repo_id=chain_r,
|
| 192 |
token=token_self,
|
| 193 |
repo_type="dataset",
|
| 194 |
)
|
| 195 |
-
os.remove("
|
| 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)
|