Skip to content

Commit

Permalink
Make Jinja2Templates.get_env private & rename (#1218)
Browse files Browse the repository at this point in the history
* make-jinja2-get-env-internal

* rename _get_env to _create_env
  • Loading branch information
aminalaee committed Jun 27, 2021
1 parent 6626636 commit 070d749
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions starlette/templating.py
Expand Up @@ -56,9 +56,9 @@ class Jinja2Templates:

def __init__(self, directory: str) -> None:
assert jinja2 is not None, "jinja2 must be installed to use Jinja2Templates"
self.env = self.get_env(directory)
self.env = self._create_env(directory)

def get_env(self, directory: str) -> "jinja2.Environment":
def _create_env(self, directory: str) -> "jinja2.Environment":
@pass_context
def url_for(context: dict, name: str, **path_params: typing.Any) -> str:
request = context["request"]
Expand Down

0 comments on commit 070d749

Please sign in to comment.