From 1bf9d1740d0b6ef6ac7236ba47de8f793b050bab Mon Sep 17 00:00:00 2001 From: Bryan Gardiner Date: Fri, 17 Mar 2023 21:16:02 -0700 Subject: [PATCH] Fix reference to undefined variable (issue #12), and fix some lint. --- CHANGELOG.md | 3 +++ src/nvd | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 542db60..edc18e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.2.1 (unreleased) +- Fixed reference to undefined variable in `StorePath` constructor (issue #12), + plus some code lint. + ## 0.2.0 (2022-10-15) - Add display of the change in closure disk size (issue #8). diff --git a/src/nvd b/src/nvd index 4caf646..0ea999e 100755 --- a/src/nvd +++ b/src/nvd @@ -43,7 +43,6 @@ import os.path import re import subprocess import sys -from collections import namedtuple from pathlib import Path from signal import SIGPIPE, SIG_DFL, signal from subprocess import PIPE @@ -103,7 +102,7 @@ def raise_arg(e): class StorePath: def __init__(self, path: Union[str, Path]): assert str(path).startswith("/nix/store/"), \ - f"Doesn't start with /nix/store/: {str(resolved)!r}" + f"Doesn't start with /nix/store/: {str(path)!r}" self._path = Path(path) def __str__(self) -> str: @@ -348,7 +347,7 @@ def render_versions(version_list: List[str], *, colour: bool = False) -> str: version_list.pop() count += 1 - if version == None: + if version is None: version = "" elif colour: # (Don't apply colour to .) version = sgr(SGR_FG + SGR_YELLOW) + version + sgr(SGR_RESET)