mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-25 09:48:36 +08:00
Reorder some open flags for Python 2
This commit is contained in:
+1
-1
@@ -131,7 +131,7 @@ def _is_potential_project(path):
|
|||||||
def _is_django_path(directory):
|
def _is_django_path(directory):
|
||||||
""" Detects the path of the very well known Django library (if used) """
|
""" Detects the path of the very well known Django library (if used) """
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(directory, 'manage.py'), 'br') as f:
|
with open(os.path.join(directory, 'manage.py'), 'rb') as f:
|
||||||
return b"DJANGO_SETTINGS_MODULE" in f.read()
|
return b"DJANGO_SETTINGS_MODULE" in f.read()
|
||||||
except (FileNotFoundError, NotADirectoryError):
|
except (FileNotFoundError, NotADirectoryError):
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user