mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Implement the get_resource_reader() API for file system imports (#5168)
This commit is contained in:
parent
21102f0dc2
commit
5ec0feeeec
6 changed files with 1356 additions and 1263 deletions
|
@ -1,10 +1,10 @@
|
|||
import sys
|
||||
import unittest
|
||||
|
||||
from importlib import resources
|
||||
from . import data01
|
||||
from . import zipdata02
|
||||
from . import util
|
||||
from importlib import resources
|
||||
|
||||
|
||||
class ResourceTests:
|
||||
|
|
|
@ -397,6 +397,9 @@ class CASEOKTestBase:
|
|||
|
||||
def create_package(file, path, is_package=True, contents=()):
|
||||
class Reader(ResourceReader):
|
||||
def get_resource_reader(self, package):
|
||||
return self
|
||||
|
||||
def open_resource(self, path):
|
||||
self._path = path
|
||||
if isinstance(file, Exception):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue