mirror of
https://github.com/django/django.git
synced 2025-10-29 08:36:09 +00:00
Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.
These functions do nothing on Python 3.
This commit is contained in:
@@ -7,7 +7,6 @@ from django.apps import apps
|
||||
from django.db import migrations
|
||||
from django.db.migrations.loader import MigrationLoader
|
||||
from django.db.migrations.serializer import serializer_factory
|
||||
from django.utils._os import upath
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.inspect import get_func_args
|
||||
from django.utils.module_loading import module_dir
|
||||
@@ -229,7 +228,7 @@ class MigrationWriter:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
return upath(module_dir(migrations_module))
|
||||
return module_dir(migrations_module)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
@@ -250,7 +249,7 @@ class MigrationWriter:
|
||||
continue
|
||||
else:
|
||||
try:
|
||||
base_dir = upath(module_dir(base_module))
|
||||
base_dir = module_dir(base_module)
|
||||
except ValueError:
|
||||
continue
|
||||
else:
|
||||
|
||||
@@ -6,7 +6,6 @@ from threading import local
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils import six
|
||||
from django.utils._os import npath, upath
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.module_loading import import_string
|
||||
|
||||
@@ -116,10 +115,10 @@ def load_backend(backend_name):
|
||||
except ImportError as e_user:
|
||||
# The database backend wasn't found. Display a helpful error message
|
||||
# listing all possible (built-in) database backends.
|
||||
backend_dir = os.path.join(os.path.dirname(upath(__file__)), 'backends')
|
||||
backend_dir = os.path.join(os.path.dirname(__file__), 'backends')
|
||||
try:
|
||||
builtin_backends = [
|
||||
name for _, name, ispkg in pkgutil.iter_modules([npath(backend_dir)])
|
||||
name for _, name, ispkg in pkgutil.iter_modules([backend_dir])
|
||||
if ispkg and name not in {'base', 'dummy', 'postgresql_psycopg2'}
|
||||
]
|
||||
except EnvironmentError:
|
||||
|
||||
Reference in New Issue
Block a user