Skip to content

Commit 163186d

Browse files
committed
Fix Pyan CLI crash for relative paths
The code included in this commit was adapted from the implementation on the Pull-Request Technologicat#74 made by the author @maciejczyzewski Resolves: Technologicat#70
1 parent d2f9584 commit 163186d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pyan/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def main(cli_args=None):
159159

160160
known_args, unknown_args = parser.parse_known_args(cli_args)
161161

162-
filenames = [fn2 for fn in unknown_args for fn2 in glob(fn, recursive=True)]
162+
filenames = [os.path.abspath(fn2) for fn in unknown_args for fn2 in glob(fn, recursive=True)]
163163

164164
# determine root
165165
if known_args.root is not None:
@@ -203,6 +203,9 @@ def main(cli_args=None):
203203
handler = logging.FileHandler(known_args.logname)
204204
logger.addHandler(handler)
205205

206+
if root:
207+
root = os.path.abspath(root)
208+
206209
v = CallGraphVisitor(filenames, logger=logger, root=root)
207210

208211
if known_args.function or known_args.namespace:

0 commit comments

Comments
 (0)