Fix resource leaking

master
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
1 changed files with 2 additions and 1 deletions

View File

@ -98,7 +98,8 @@ class Block:
filelocation = 'data/blocks/%s.dat' % self.getHash() 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 self.blockFile = filelocation
else: else: