* usr/lib/byobu/include/config.py.in, usr/lib/byobu/include/select-

session.py: LP: #1711026
  - Byobu currently FTBFS on artful during pep8 verification due to
    the newly introduced E722 - ie. a 'try:/except:' block with a
    bare except that should be replaced by a 'try:except Exception:' block.
This commit is contained in:
Dustin Kirkland 2017-08-17 16:54:20 -05:00
commit e266bebe9c
3 changed files with 20 additions and 15 deletions

7
debian/changelog vendored
View file

@ -1,6 +1,11 @@
byobu (5.122) unreleased; urgency=medium
* UNRELEASED
[ Tiago Stürmer Daitx ]
* usr/lib/byobu/include/config.py.in, usr/lib/byobu/include/select-
session.py: LP: #1711026
- Byobu currently FTBFS on artful during pep8 verification due to
the newly introduced E722 - ie. a 'try:/except:' block with a
bare except that should be replaced by a 'try:except Exception:' block.
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 09 Aug 2017 16:53:48 -0500

View file

@ -42,7 +42,7 @@ def error(msg):
try:
import snack
from snack import *
except:
except Exception:
error("Could not import the python snack module")
@ -81,7 +81,7 @@ def ioctl_GWINSZ(fd):
import struct
import os
cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
except:
except Exception:
return None
return cr
@ -96,7 +96,7 @@ def reload_required():
f.close()
if BYOBU_BACKEND == "screen":
subprocess.call([BYOBU_BACKEND, "-X", "at", "0", "source", "%s/profile" % BYOBU_CONFIG_DIR])
except:
except Exception:
True
@ -110,13 +110,13 @@ def terminal_size():
fd = os.open(os.ctermid(), os.O_RDONLY)
cr = ioctl_GWINSZ(fd)
os.close(fd)
except:
except Exception:
pass
if not cr:
# env vars or finally defaults
try:
cr = (env['LINES'], env['COLUMNS'])
except:
except Exception:
cr = (25, 80)
# reverse rows, cols
return int(cr[1] - 5), int(cr[0] - 5)
@ -173,7 +173,7 @@ def readstatus():
if os.path.exists(f):
try:
exec(open(f).read(), glo, loc)
except:
except Exception:
error("Invalid configuration [%s]" % f)
if BYOBU_BACKEND == "tmux":
items = "%s %s" % (loc["tmux_left"], loc["tmux_right"])
@ -217,13 +217,13 @@ def writestatus(items):
if key.startswith(BYOBU_BACKEND):
try:
f = open(path, "r")
except:
except Exception:
f = open(SHARE + '/status/status', "r")
lines = f.readlines()
f.close()
try:
f = open(path, "w")
except:
except Exception:
f = open(path, "a+")
for l in lines:
if l.startswith("%s=" % key):
@ -341,7 +341,7 @@ def chgesc(snackScreen, size):
try:
dummy = int(esc.value())
esc.set(DEF_ESC)
except:
except Exception:
# do nothing
dummy = "foo"
else:
@ -363,7 +363,7 @@ def autolaunch():
for line in open("%s/.profile" % HOME):
if "byobu-launch" in line:
return 1
except:
except Exception:
return 0
if os.path.exists("/etc/profile.d/Z97-%s.sh" % PKG):
return 1

View file

@ -27,7 +27,7 @@ import subprocess
try:
# For Python3, try and import input from builtins
from builtins import input
except:
except Exception:
# But fall back to using the default input
True
@ -156,14 +156,14 @@ if len(sessions) > 1:
try:
try:
user_input = input("\nChoose 1-%d [1]: " % (i - 1))
except:
except Exception:
user_input = ""
if not user_input or user_input == "":
choice = 1
break
try:
choice = int(user_input)
except:
except Exception:
choice = int(eval(user_input))
if choice >= 1 and choice < i:
break
@ -174,7 +174,7 @@ if len(sessions) > 1:
except KeyboardInterrupt:
sys.stdout.write("\n")
sys.exit(0)
except:
except Exception:
if choice == "" or choice == -1:
choice = 1
break