Browse Source

Use importlib.metadata instead of pkg_resources

pull/8385/head
Rapptz 3 years ago
parent
commit
7c1dffbf9d
  1. 8
      discord/__main__.py

8
discord/__main__.py

@ -31,7 +31,7 @@ import sys
from pathlib import Path
import discord
import pkg_resources
import importlib.metadata
import aiohttp
import platform
@ -43,9 +43,9 @@ def show_version() -> None:
version_info = discord.version_info
entries.append('- discord.py v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}'.format(version_info))
if version_info.releaselevel != 'final':
pkg = pkg_resources.get_distribution('discord.py')
if pkg:
entries.append(f' - discord.py pkg_resources: v{pkg.version}')
version = importlib.metadata.version('discord.py')
if version:
entries.append(f' - discord.py metadata: v{version}')
entries.append(f'- aiohttp v{aiohttp.__version__}')
uname = platform.uname()

Loading…
Cancel
Save