thinc icon indicating copy to clipboard operation
thinc copied to clipboard

Switch on `importlib.resources`

Open shadchin opened this issue 1 year ago • 0 comments

Description

What's wrong with__file__? The assumption that you have files and subdirectories available is not correct. This approach doesn't work if executing code which is packed in a zip or a wheel, and it may be entirely out of the user's control whether or not your package gets extracted to a filesystem at all.

Types of change

Switch on importlib.resources.files (Added in version Python 3.9.)

Checklist

  • [x] I confirm that I have the right to submit this contribution under the project's MIT license.
  • [x] I ran the tests, and all new and existing tests passed.
  • [x] My changes don't require a change to the documentation, or if they do, I've added all required information.

shadchin avatar May 04 '24 06:05 shadchin