diff --git a/scripts/lib/setup_path_on_import.py b/scripts/lib/setup_path_on_import.py index 7c00e566dd..f3ac0f6720 100644 --- a/scripts/lib/setup_path_on_import.py +++ b/scripts/lib/setup_path_on_import.py @@ -3,7 +3,7 @@ Use libraries from a virtualenv (by modifying sys.path) in production. Also add Zulip's root directory to sys.path """ -import os.path +import os import sys BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index b54b6a0796..179aadf206 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -326,6 +326,9 @@ def build_custom_checkers(by_lang): {'pattern': 'from os.path', 'description': "Don't use from when importing from the standard library", }, + {'pattern': 'import os.path', + 'description': "Use import os instead of import os.path", + }, ]) + whitespace_rules bash_rules = [ {'pattern': '#!.*sh [-xe]', diff --git a/tools/zulip-export/zulip-export b/tools/zulip-export/zulip-export index ee8f8d9b28..dc1ab24246 100755 --- a/tools/zulip-export/zulip-export +++ b/tools/zulip-export/zulip-export @@ -23,7 +23,7 @@ from __future__ import print_function import sys -import os.path +import os import optparse import time import json diff --git a/zerver/lib/bugdown/__init__.py b/zerver/lib/bugdown/__init__.py index 690c16250e..28d0d2e0a4 100644 --- a/zerver/lib/bugdown/__init__.py +++ b/zerver/lib/bugdown/__init__.py @@ -11,7 +11,7 @@ import logging import traceback from six.moves import urllib import re -import os.path +import os import glob import html import twitter diff --git a/zerver/lib/cache.py b/zerver/lib/cache.py index 6ce4a0fc75..1e4caeb80e 100644 --- a/zerver/lib/cache.py +++ b/zerver/lib/cache.py @@ -18,7 +18,6 @@ import base64 import random import sys import os -import os.path import hashlib import six diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.py index 0b90c7e0bd..b990742882 100644 --- a/zerver/lib/integrations.py +++ b/zerver/lib/integrations.py @@ -1,5 +1,5 @@ from __future__ import absolute_import -import os.path +import os from typing import Dict, List, Optional, TypeVar, Any, Text from django.conf import settings diff --git a/zerver/lib/unminify.py b/zerver/lib/unminify.py index dc4805d2a6..9224ef8291 100644 --- a/zerver/lib/unminify.py +++ b/zerver/lib/unminify.py @@ -1,7 +1,7 @@ from __future__ import absolute_import import re -import os.path +import os import sourcemap from six.moves import map diff --git a/zerver/templatetags/app_filters.py b/zerver/templatetags/app_filters.py index 37ddc4dc0c..67acd5ab44 100644 --- a/zerver/templatetags/app_filters.py +++ b/zerver/templatetags/app_filters.py @@ -1,5 +1,5 @@ from typing import Dict, Optional, Any, List -import os.path +import os from django.conf import settings from django.template import Library, loader, engines diff --git a/zproject/dev_urls.py b/zproject/dev_urls.py index a7a60b81da..defe676414 100644 --- a/zproject/dev_urls.py +++ b/zproject/dev_urls.py @@ -1,7 +1,7 @@ from django.conf.urls import url from django.conf import settings from django.views.generic import TemplateView -import os.path +import os from django.views.static import serve import zerver.views.registration import zerver.views.auth diff --git a/zproject/urls.py b/zproject/urls.py index 76a155e031..0d750bf7c0 100644 --- a/zproject/urls.py +++ b/zproject/urls.py @@ -3,7 +3,7 @@ from django.conf.urls import url, include from django.conf.urls.i18n import i18n_patterns from django.views.generic import TemplateView, RedirectView from django.utils.module_loading import import_string -import os.path +import os import zerver.forms from zproject import dev_urls from zproject.legacy_urls import legacy_urls