diff --git a/python/torch_mlir/extras/fx_importer.py b/python/torch_mlir/extras/fx_importer.py index 9ec90e766c46..d799d61f6a92 100644 --- a/python/torch_mlir/extras/fx_importer.py +++ b/python/torch_mlir/extras/fx_importer.py @@ -5,10 +5,16 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # Also available under a BSD-style license. See LICENSE. +try: + from types import NoneType +except ImportError: + # python less than 3.10 doesn't have NoneType + NoneType = type(None) + import logging import operator import re -from types import NoneType, BuiltinMethodType, BuiltinFunctionType +from types import BuiltinMethodType, BuiltinFunctionType from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Union import weakref