Skip to content

Commit

Permalink
Move as_file to the global namespace and update documentation accordi…
Browse files Browse the repository at this point in the history
…ngly. Closes python#86.
  • Loading branch information
jaraco committed Mar 5, 2020
1 parent 6e91e7f commit a4cf54d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions importlib_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import sys

from ._compat import metadata
from .trees import as_file


__all__ = [
'Package',
'Resource',
'ResourceReader',
'as_file',
'contents',
'files',
'is_resource',
Expand Down
3 changes: 1 addition & 2 deletions importlib_resources/docs/using.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ to this temporary file as a :py:class:`pathlib.Path` object. In order to
properly clean up this temporary file, what's actually returned is a context
manager that you can use in a ``with``-statement::

from importlib_resources import files
from importlib_resources.trees import as_file
from importlib_resources import files, as_file

source = files(email.tests.data).joinpath('message.eml')
with as_file(source) as eml:
Expand Down

0 comments on commit a4cf54d

Please sign in to comment.