The createDefaultKnownNodes function now uses a with statement #388
|
@ -37,12 +37,10 @@ def createDefaultKnownNodes(appdata):
|
||||||
#print stream1
|
#print stream1
|
||||||
#print allKnownNodes
|
#print allKnownNodes
|
||||||
|
|
||||||
output = open(appdata + 'knownnodes.dat', 'wb')
|
with open(appdata + 'knownnodes.dat', 'wb) as output:
|
||||||
|
|
||||||
# Pickle dictionary using protocol 0.
|
# Pickle dictionary using protocol 0.
|
||||||
pickle.dump(allKnownNodes, output)
|
pickle.dump(allKnownNodes, output)
|
||||||
|
|
||||||
output.close()
|
|
||||||
return allKnownNodes
|
return allKnownNodes
|
||||||
|
|
||||||
def readDefaultKnownNodes(appdata):
|
def readDefaultKnownNodes(appdata):
|
||||||
|
|
Reference in New Issue
Block a user