Skip to content

Commit 392a38f

Browse files
committed
Use BASE_DIR as starting point for finding patch files in checks.maybe_patch_libraries(), instead of CWD.
- Legacy-Id: 18468
1 parent f9b3e2e commit 392a38f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ietf/checks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,13 @@ def maybe_patch_library(app_configs, **kwargs):
302302
import os, django
303303
django_path = os.path.dirname(django.__file__)
304304
library_path = os.path.dirname(django_path)
305-
cwd = os.getcwd()
305+
top_dir = os.path.dirname(settings.BASE_DIR)
306306
# All patches in settings.CHECKS_LIBRARY_PATCHES_TO_APPLY must have a
307307
# relative file path rooted in the django dir, for instance
308308
# 'django/db/models/fields/__init__.py'
309309
for patch_file in settings.CHECKS_LIBRARY_PATCHES_TO_APPLY:
310310
try:
311-
patch_path = os.path.join(cwd, patch_file)
311+
patch_path = os.path.join(top_dir, patch_file)
312312
patch_set = patch.fromfile(patch_path)
313313
if patch_set:
314314
if not patch_set.apply(root=library_path.encode('utf-8')):

0 commit comments

Comments
 (0)