Skip to content
Discussion options

You must be logged in to vote

Providing a standalone reproduces would be a non-trivial task. However, here is a more detailed explanation:

A custom_target generates a Python file like this example:

<path>/module.py

import ctypes

class A(ctypes.Structure):
    _fields_ =("var", ctypes.c_int)]

Because it is generated as part of a custom_target, the file is placed in <project dir>/build/cp314/<path>.

Now, in my Python application, I want to do import <path>.<module>. What I was seeing is that it would attempt to load it from <project dir>/<path> rather then <project dir>/build/cp314/<path>/module.py.

However, I don't know what I did but it is working properly now. We can close this discussion.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@voidtrance
Comment options

Answer selected by rgommers
@rgommers
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants