Skip to content

Commit

Permalink
Using "custom" getsitepackages().
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Jan 22, 2020
1 parent 2b5ade0 commit bb57ffd
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions win_wat.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import ctypes
import os
import site
import textwrap

import numpy as np


def _sort_key(name):
"""Sorting helper for members of a directory."""
Expand Down Expand Up @@ -42,6 +43,16 @@ def print_tree(directory, suffix=None):
print(textwrap.indent(full_tree, " "))


def getsitepackages():
path = np.__file__
assert os.path.basename(path) == "__init__.py"
path = os.path.dirname(path)
assert os.path.basename(path) == "numpy"
path = os.path.dirname(path)
assert os.path.basename(path) == "site-packages"
return path


def main():
try:
import bezier
Expand All @@ -50,7 +61,7 @@ def main():
except ImportError as exc:
print(f"exc = {exc} ({exc!r})")

(sitepackages,) = site.getsitepackages()
sitepackages = getsitepackages()
extra_dll = os.path.join(sitepackages, "bezier", "extra-dll")
print(f"extra_dll = {extra_dll!r}")
print_tree(extra_dll)
Expand Down

0 comments on commit bb57ffd

Please sign in to comment.