Skip to content

Commit

Permalink
Fix a compatible issue with very old version of Python
Browse files Browse the repository at this point in the history
  • Loading branch information
aisk committed Feb 27, 2024
1 parent 1f6cad4 commit 5b0bf92
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion thriftpy2/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import absolute_import

import sys
import importlib.abc
import importlib.util
import types

Expand All @@ -15,6 +14,8 @@
# specified thrift file does not exists, it raises FileNotFoundError, and skiped
# the other meta finders in the sys.meta_path.
if sys.version_info >= (3, 4):
import importlib.abc

class ThriftImporter(importlib.abc.MetaPathFinder):
def __init__(self, extension="_thrift"):
self.extension = extension
Expand Down

0 comments on commit 5b0bf92

Please sign in to comment.