1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Ref #23919 -- Replaced some os.path usage with pathlib.Path.

This commit is contained in:
Tom
2017-07-21 21:33:26 +01:00
committed by Tim Graham
parent 5d923f2d8c
commit 11b8c30b9e
10 changed files with 54 additions and 57 deletions

View File

@@ -1,5 +1,5 @@
import functools
import os
from pathlib import Path
from django.conf import settings
from django.template.backends.django import DjangoTemplates
@@ -13,7 +13,7 @@ except ImportError:
def Jinja2(params):
raise ImportError("jinja2 isn't installed")
ROOT = os.path.dirname(__file__)
ROOT = Path(__file__).parent
@functools.lru_cache()
@@ -39,7 +39,7 @@ class EngineMixin:
def engine(self):
return self.backend({
'APP_DIRS': True,
'DIRS': [os.path.join(ROOT, self.backend.app_dirname)],
'DIRS': [str(ROOT / self.backend.app_dirname)],
'NAME': 'djangoforms',
'OPTIONS': {},
})