From 093faebac29ea6dc8c15366e586ae0c9415c1f6e Mon Sep 17 00:00:00 2001 From: Sam Whitlock <433170+samwhitlock@users.noreply.github.com> Date: Mon, 21 Oct 2019 20:56:44 +0200 Subject: [PATCH] Fixing no-assignment issue in _diff_before_write If content is None, then tmp is never created. Need to check before calling utils.remove, which does not handle None as its input. --- dotdrop/installer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dotdrop/installer.py b/dotdrop/installer.py index 413c3e2..564b30b 100644 --- a/dotdrop/installer.py +++ b/dotdrop/installer.py @@ -422,7 +422,8 @@ class Installer: tmp = utils.write_to_tmpfile(content) src = tmp diff = utils.diff(src, dst, raw=False) - utils.remove(tmp, quiet=True) + if tmp: + utils.remove(tmp, quiet=True) # fake the output for readability if not diff: