From 72ebddfac7aa14f16a814a1b0c8ff4a01c42389f Mon Sep 17 00:00:00 2001 From: Mark Blakeney Date: Sun, 15 Mar 2020 18:50:09 +1000 Subject: [PATCH] Python 2 is not supported anymore Fixes issue #11. --- .gitignore | 1 + Makefile | 2 +- README.md | 7 ++++--- edid-rw | 7 ++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index daa30a3..4fc4333 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +venv/ README.html diff --git a/Makefile b/Makefile index 6649ddc..9b929a8 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ $(DOC): $(SRC) check: flake8 $(PROG) - vermin -i -q $(PROG) + vermin --no-tips -i -q $(PROG) install:: install -CD $(PROG) ~/bin diff --git a/README.md b/README.md index 204fad0..1a606a2 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ EDID. ## Installation -Requires python smbus module and edid-decode utility. +Requires python3 smbus module, and edid-decode utility. Install these prerequisites on Debian/Ubuntu: - sudo apt-get install python-smbus edid-decode + sudo apt-get install python3-smbus edid-decode Or, install these prerequisites on Arch: @@ -29,7 +29,8 @@ Get this source code: git clone https://github.com/bulletmark/edid-rw cd edid-rw -This utility should run using python version 2.5+, or 3+. +This utility should run using Python version 3.2+. It does not work with +Python 2. ## Usage diff --git a/edid-rw b/edid-rw index 5782b3c..c31de20 100755 --- a/edid-rw +++ b/edid-rw @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ''' Program to read or write Extended Display Identification Data (EDID) to a digital display. Default action is to READ binary EDID data from @@ -104,8 +104,9 @@ def main(): if actsum != calsum: if args.fix: edid[x - 1] = calsum - sys.exit('%s checksum 0x%02x was BAD, rewrote it to ' - '0x%02x.' % (blkname(b), actsum, calsum)) + sys.stderr.write( + '%s checksum 0x%02x was BAD, rewrote it to ' + '0x%02x.\n' % (blkname(b), actsum, calsum)) else: sys.exit('ERROR: %s checksum 0x%02x is BAD, should be ' '0x%02x.' % (blkname(b), actsum, calsum))