Fix bug with Module.to_bitcode() (Reported by Jun Koi)

This commit is contained in:
Siu Kwan Lam 2013-05-14 10:32:37 -05:00
commit 08bed7dd74

View file

@ -535,7 +535,7 @@ class Module(llvm.Wrapper):
ret = False ret = False
if fileobj is None: if fileobj is None:
ret = True ret = True
fileobj = BytesIO fileobj = BytesIO()
api.llvm.WriteBitcodeToFile(self._ptr, fileobj) api.llvm.WriteBitcodeToFile(self._ptr, fileobj)
if ret: if ret:
return fileobj.getvalue() return fileobj.getvalue()