Skip to content

Commit

Permalink
[misc] Fix manylinux2014 warning not printing (#7270)
Browse files Browse the repository at this point in the history
Issue: #

### Brief Summary
  • Loading branch information
feisuzhu authored and lin-hitonami committed Feb 1, 2023
1 parent dff4d2f commit 4b0e00c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions python/taichi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from taichi._funcs import *
from taichi._lib import core as _ti_core
from taichi._lib.utils import warn_restricted_version
from taichi._logging import *
from taichi._snode import *
from taichi.lang import * # pylint: disable=W0622 # TODO(archibate): It's `taichi.lang.core` overriding `taichi.core`
Expand Down Expand Up @@ -93,3 +94,6 @@ def __getattr__(attr):

del sys
del _ti_core

warn_restricted_version()
del warn_restricted_version
8 changes: 4 additions & 4 deletions python/taichi/_lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import platform
import re
import sys
import warnings

from colorama import Fore, Style

Expand Down Expand Up @@ -202,7 +203,9 @@ def try_get_loaded_libc_version():

def try_get_pip_version():
try:
import pip # pylint: disable=import-outside-toplevel
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import pip # pylint: disable=import-outside-toplevel
return tuple([int(v) for v in pip.__version__.split('.')])
except ImportError:
return None
Expand Down Expand Up @@ -244,6 +247,3 @@ def warn_restricted_version():
)
except Exception:
pass


warn_restricted_version()

0 comments on commit 4b0e00c

Please sign in to comment.