Enabled PDFDevice in the with statement (#88)

pull/98/head
SUZUKI Masaya 2017-08-18 15:15:04 +09:00 committed by Goulu
parent e39800f14c
commit d4118cf5e8
1 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,12 @@ class PDFDevice(object):
def __repr__(self): def __repr__(self):
return '<PDFDevice>' return '<PDFDevice>'
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()
def close(self): def close(self):
return return