From 723d6cce99e75ff1a41ae53d674e9c69c790734d Mon Sep 17 00:00:00 2001 From: Balakrishnan Balasubramanian Date: Mon, 5 Dec 2022 21:01:46 -0500 Subject: [PATCH] use devnull --- vimtabdiff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vimtabdiff.py b/vimtabdiff.py index 486b534..c67b542 100755 --- a/vimtabdiff.py +++ b/vimtabdiff.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -import os,sys +import os import argparse import pathlib import itertools @@ -59,8 +59,8 @@ def main(): vimCmdFile = tempfile.NamedTemporaryFile(mode='w', delete=False) with vimCmdFile: for a, b in get_file_pairs(args.pathA, args.pathB): - aPath = a.resolve() if a else "/dev/null" - bPath = b.resolve() if b else "/dev/null" + aPath = a.resolve() if a else os.devnull + bPath = b.resolve() if b else os.devnull print(f"tabedit {aPath} | diffthis | vsp {bPath} | diffthis | diffupdate", file=vimCmdFile) print("tabrewind | bdelete", file=vimCmdFile) print(f"""call delete("{vimCmdFile.name}")""", file=vimCmdFile)