|
26 | 26 | # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
27 | 27 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
28 | 28 |
|
| 29 | +import argparse |
29 | 30 | import ctypes |
| 31 | +import logging |
30 | 32 | import os |
31 | 33 | import sys |
32 | 34 | from ctypes.util import find_library as _find_library |
33 | | -from logging import getLogger as _getLogger |
| 35 | +from functools import wraps |
34 | 36 | from sysconfig import get_config_var as _get_config_var |
35 | 37 |
|
36 | 38 | from find_libpython._version import __version__ # noqa: F401 |
37 | 39 |
|
38 | | -_logger = _getLogger("find_libpython") |
| 40 | +_logger = logging.getLogger("find_libpython") |
39 | 41 |
|
40 | 42 | _is_apple = sys.platform == "darwin" |
41 | 43 | _is_cygwin = sys.platform in ("msys", "cygwin") |
@@ -122,7 +124,6 @@ def _uniquifying(items): |
122 | 124 |
|
123 | 125 | def _uniquified(func): |
124 | 126 | """Wrap iterator returned from `func` by `_uniquifying`.""" |
125 | | - from functools import wraps |
126 | 127 |
|
127 | 128 | @wraps(func) |
128 | 129 | def wrapper(*args, **kwds): |
@@ -392,8 +393,6 @@ def _print_all(items): |
392 | 393 |
|
393 | 394 |
|
394 | 395 | def _cli_find_libpython(cli_op, verbose): |
395 | | - import logging |
396 | | - |
397 | 396 | # Importing `logging` module here so that using `logging.debug` |
398 | 397 | # instead of `_logger.debug` outside of this function becomes an |
399 | 398 | # error. |
@@ -425,8 +424,6 @@ def _log_platform_info(): |
425 | 424 |
|
426 | 425 |
|
427 | 426 | def main(args=None): |
428 | | - import argparse |
429 | | - |
430 | 427 | parser = argparse.ArgumentParser(description=__doc__) |
431 | 428 | parser.add_argument( |
432 | 429 | "-v", "--verbose", action="store_true", help="Print debugging information." |
|
0 commit comments