def save(self, filename=None):
self.check_filename(filename)
fh = None
try:
data = (self.title, self.year, self.duration, self.director_id)
with open(self.filename, 'wb') as fh:
pickle.dump(data, fh)
except (EnvironmentError, pickle.PicklingError) as err:
raise SaveError(str(err))
评论列表
文章目录