summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS.txt3
-rw-r--r--ChangeLog4
-rw-r--r--pylint/graph.py13
3 files changed, 7 insertions, 13 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index eb96651a5..0b82832b7 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -366,4 +366,7 @@ contributors:
* Anubhav: contributor
+* Ben Graham: contributor
+
* Anthony Tan: contributor
+
diff --git a/ChangeLog b/ChangeLog
index 85a37b566..6a637e4d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,9 +7,7 @@ What's New in Pylint 2.5.0?
Release date: TBA
-* Remove unused import
-
- Close #3379
+* Fixed graph creation for relative paths
* Add a check for asserts on string literals.
diff --git a/pylint/graph.py b/pylint/graph.py
index 0dc7a1460..9e0348144 100644
--- a/pylint/graph.py
+++ b/pylint/graph.py
@@ -71,30 +71,23 @@ class DotBackend:
source = property(get_source)
- def generate(self, outputfile=None, dotfile=None, mapfile=None):
+ def generate(self, outputfile=None, mapfile=None):
"""Generates a graph file.
:param str outputfile: filename and path [defaults to graphname.png]
- :param str dotfile: filename and path [defaults to graphname.dot]
:param str mapfile: filename and path
:rtype: str
:return: a path to the generated file
"""
name = self.graphname
- if not dotfile:
- # if 'outputfile' is a dot file use it as 'dotfile'
- if outputfile and outputfile.endswith(".dot"):
- dotfile = outputfile
- else:
- dotfile = "%s.dot" % name
if outputfile is not None:
- storedir, _, target = target_info_from_filename(outputfile)
+ _, _, target = target_info_from_filename(outputfile)
if target != "dot":
pdot, dot_sourcepath = tempfile.mkstemp(".dot", name)
os.close(pdot)
else:
- dot_sourcepath = osp.join(storedir, dotfile)
+ dot_sourcepath = outputfile
else:
target = "png"
pdot, dot_sourcepath = tempfile.mkstemp(".dot", name)