Skip to content
Discussion options

You must be logged in to vote

AttributeError: 'module' object has no attribute 'sub'

@saraverbeecke The problem is that fnmatch is using re.sub (see https://github.com/micropython/micropython-lib/blob/master/python-stdlib/fnmatch/fnmatch.py#L135) but this is not available by default on the unix build on whichever build you're using.

But in the meantime, you can enable it in your build by adding

#define MICROPY_PY_URE_SUB (1)

in either unix/mpconfigport.h (or your mpconfigvariant.h if you have one).

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@jimmo
Comment options

@saraverbeecke
Comment options

@jimmo
Comment options

Answer selected by saraverbeecke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants