Fix resource leaking

This commit is contained in:
Arinerron 2018-05-19 15:22:35 -07:00
parent 0ac27ad0e2
commit e03a47d7f8
No known key found for this signature in database
GPG Key ID: 99383627861C62F0

View File

@ -98,7 +98,8 @@ class Block:
filelocation = 'data/blocks/%s.dat' % self.getHash()
blockdata = open(filelocation, 'rb').read().decode('utf-8')
with open(filelocation, 'rb') as f:
blockdata = f.read().decode('utf-8')
self.blockFile = filelocation
else: