[windows] Remove unused pybind exception params
authorNathaniel McVicar <namcvica@microsoft.com>
Tue, 31 May 2022 17:03:48 +0000 (10:03 -0700)
committerStella Stamenova <stilis@microsoft.com>
Tue, 31 May 2022 19:36:57 +0000 (12:36 -0700)
Resolve MSVC warning C4104 for unreferenced variable

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D126683

mlir/lib/Bindings/Python/IRInterfaces.cpp

index 1fc66fe..3f50d3b 100644 (file)
@@ -63,13 +63,13 @@ public:
       : obj(std::move(object)) {
     try {
       operation = &py::cast<PyOperation &>(obj);
-    } catch (py::cast_error &err) {
+    } catch (py::cast_error &) {
       // Do nothing.
     }
 
     try {
       operation = &py::cast<PyOpView &>(obj).getOperation();
-    } catch (py::cast_error &err) {
+    } catch (py::cast_error &) {
       // Do nothing.
     }
 
@@ -86,7 +86,7 @@ public:
     } else {
       try {
         opName = obj.attr("OPERATION_NAME").template cast<std::string>();
-      } catch (py::cast_error &err) {
+      } catch (py::cast_error &) {
         throw py::type_error(
             "Op interface does not refer to an operation or OpView class");
       }