Skip to content

Commit

Permalink
Fix DeprecationWarning for locale.getdefaultlocale() in diagnose.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bluevisor authored Nov 10, 2024
1 parent e9f19b8 commit 05b976c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/taichi/tools/diagnose.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ def main():
print(f"platform: {platform.platform()}")
print(f'architecture: {" ".join(platform.architecture())}')
print(f"uname: {platform.uname()}")

print(f'locale: {".".join(locale.getdefaultlocale())}')
locale.setlocale(locale.LC_ALL, '')
loc, enc = locale.getlocale(), locale.getpreferredencoding()
print(f'locale: {loc[0]}.{enc if enc else loc[1]}')
print(f'PATH: {os.environ.get("PATH")}')
print(f"PYTHONPATH: {sys.path}")
print("")
Expand Down

0 comments on commit 05b976c

Please sign in to comment.