Skip to content

Commit

Permalink
[SOT][3.12] remove distutils import to avoid import error (PaddlePadd…
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo authored and hitywt committed Oct 24, 2023
1 parent c87a3f4 commit ba5b95f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/paddle/jit/sot/opcode_translator/skip_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import copy
import copyreg
import dataclasses
import distutils
import enum
import functools
import importlib
Expand Down Expand Up @@ -94,7 +93,6 @@
codecs,
uuid,
setuptools,
distutils,
warnings,
}

Expand All @@ -105,6 +103,11 @@
NEED_SKIP_THIRD_PARTIY_MODULES.add(sre_compile)
NEED_SKIP_THIRD_PARTIY_MODULES.add(sre_parse)

if sys.version_info < (3, 12):
import distutils

NEED_SKIP_THIRD_PARTIY_MODULES.add(distutils)


def _strip_init_py(s):
return re.sub(r"__init__.py$", "", s)
Expand Down

0 comments on commit ba5b95f

Please sign in to comment.