File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -258,9 +258,17 @@ def _init_version_locations(self) -> None:
258258 if plugin .metadata and (
259259 version_module := plugin .metadata .extra .get ("orm_version_location" )
260260 ):
261- version_location = files (version_module )
261+ if sys .version_info [:2 ] == (3 , 9 ):
262+ # importlib_resources.files() return a opaque Traversable object
263+ # even if the anchor is a namespace package in Python 3.9
264+ version_location = Path (version_module .__path__ [0 ])
265+ else :
266+ version_location = files (version_module )
262267 else :
263- version_location = files (plugin .module ) / "migrations"
268+ if sys .version_info [:2 ] == (3 , 9 ):
269+ version_location = Path (plugin .module .__path__ [0 ]) / "migrations"
270+ else :
271+ version_location = files (plugin .module ) / "migrations"
264272
265273 temp_version_location = Path (
266274 * map (attrgetter ("name" ), reversed (list (get_parent_plugins (plugin )))),
You can’t perform that action at this time.
0 commit comments