Skip to content

Commit

Permalink
Import pkg_resources only when needed
Browse files Browse the repository at this point in the history
Importing it is slow and might harm performance on CLI applications
that run many times for a short time.
See pypa/setuptools#510
  • Loading branch information
quimey committed Apr 27, 2020
1 parent f618308 commit 9686602
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion confight.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import logging
import argparse
import itertools
import pkg_resources
from collections import OrderedDict
try:
from ConfigParser import ConfigParser
Expand Down Expand Up @@ -244,6 +243,7 @@ def format_from_path(path):


def get_version():
import pkg_resources
return 'confight ' + pkg_resources.get_distribution('confight').version


Expand Down

0 comments on commit 9686602

Please sign in to comment.