Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions openfst/extensions/python/pywrapfst.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3176,18 +3176,18 @@ cdef class VectorFst(MutableFst):


cdef Fst _init_Fst(FstClass_ptr tfst):
if tfst.Properties(fst.kError, True) == fst.kError:
raise FstOpError("Operation failed")
cdef Fst _ofst = Fst.__new__(Fst)
_ofst._fst.reset(tfst)
if _ofst._fst.get().Properties(fst.kError, True) == fst.kError:
raise FstOpError("Operation failed")
return _ofst


cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
if tfst.Properties(fst.kError, True) == fst.kError:
raise FstOpError("Operation failed")
cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
_ofst._fst.reset(tfst)
if _ofst._fst.get().Properties(fst.kError, True) == fst.kError:
raise FstOpError("Operation failed")
# Makes a copy of it as the derived type! Cool.
_ofst._mfst = static_pointer_cast[fst.MutableFstClass,
fst.FstClass](_ofst._fst)
Expand Down
Loading