summaryrefslogtreecommitdiff
path: root/pylint/epylint.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-30 23:40:38 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-31 00:01:42 +0200
commit3a2a579d1561c6248862e8573b8740c1d9d13e8e (patch)
tree5b4886214928ebcd51ab05b984cda69391e77fa3 /pylint/epylint.py
parentda599c68b07694213666660e8e9f06afb88ef7ec (diff)
downloadpylint-git-3a2a579d1561c6248862e8573b8740c1d9d13e8e.tar.gz
Make import from os.path more explicit
Diffstat (limited to 'pylint/epylint.py')
-rwxr-xr-xpylint/epylint.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/pylint/epylint.py b/pylint/epylint.py
index b273b0bad..849955cee 100755
--- a/pylint/epylint.py
+++ b/pylint/epylint.py
@@ -59,7 +59,6 @@ import os
import shlex
import sys
from io import StringIO
-from os import path as osp
from subprocess import PIPE, Popen
@@ -88,13 +87,15 @@ def lint(filename, options=()):
the tree)
"""
# traverse downwards until we are out of a python package
- full_path = osp.abspath(filename)
- parent_path = osp.dirname(full_path)
- child_path = osp.basename(full_path)
+ full_path = os.path.abspath(filename)
+ parent_path = os.path.dirname(full_path)
+ child_path = os.path.basename(full_path)
- while parent_path != "/" and osp.exists(osp.join(parent_path, "__init__.py")):
- child_path = osp.join(osp.basename(parent_path), child_path)
- parent_path = osp.dirname(parent_path)
+ while parent_path != "/" and os.path.exists(
+ os.path.join(parent_path, "__init__.py")
+ ):
+ child_path = os.path.join(os.path.basename(parent_path), child_path)
+ parent_path = os.path.dirname(parent_path)
# Start pylint
# Ensure we use the python and pylint associated with the running epylint
@@ -189,7 +190,7 @@ def Run():
if len(sys.argv) == 1:
print("Usage: %s <filename> [options]" % sys.argv[0])
sys.exit(1)
- elif not osp.exists(sys.argv[1]):
+ elif not os.path.exists(sys.argv[1]):
print("%s does not exist" % sys.argv[1])
sys.exit(1)
else: