Fix issue with float_attr.

pull/1/head
Stella Laurenzo 2020-06-06 22:01:38 -07:00
parent f67c5a42dc
commit 28048337ae
3 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@
import string
import sys
_ENABLED = False
_ENABLED = True
_formatter = string.Formatter()

View File

@ -8,6 +8,7 @@ def binary_expression():
a = 1
b = 100
c = a * b + 4
c = c * 2.0
return c
fe = ImportFrontend()

View File

@ -437,7 +437,7 @@ void PyContext::bind(py::module m) {
},
py::arg("type"), py::arg("value"))
.def("float_attr",
[](PyContext &self, PyType type, double value) {
[](PyContext &self, PyType type, double value) -> PyAttribute {
if (!type.type.isa<FloatType>()) {
throw py::raiseValueError("Expected FloatType");
}