Skip to content

Commit

Permalink
Fix some broken error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
walles committed Feb 19, 2017
1 parent f8fe6f2 commit 10f7f48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions px/px_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ def _install(src, dest):
return

if not os.path.isfile(src):
raise IOError("Source is not a file: %s" % src)
raise IOError("Source is not a file: %s" % (src,))

parent = os.path.dirname(dest)
if not os.path.isdir(parent):
raise IOError("Destination parent is not a directory: %s" % parent)
raise IOError("Destination parent is not a directory: %s" % (parent,))

if os.path.isdir(dest):
raise IOError("Destination is a directory, won't replace that: %s" % dest)
raise IOError("Destination is a directory, won't replace that: %s" % (dest,))

# Make sure nothing's in the way
try:
os.remove(dest)
except OSError:
pass
if os.path.exists(dest):
raise IOError("Can't remove existing entry: %s" % dest)
raise IOError("Can't remove existing entry: %s" % (dest,))

shutil.copyfile(src, dest)
os.chmod(dest, 0o755)
4 changes: 2 additions & 2 deletions px/px_load_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class PxLoadBar(object):

def __init__(self, physical=None, logical=None):
if physical is None or physical < 1:
raise ValueError("Physical must be a positive integer")
raise ValueError("Physical must be a positive integer, was: %r" % (physical,))

if logical is None or logical < physical:
raise ValueError("Logical must be a positive integer >= physical (%r)" % physical)
raise ValueError("Logical must be an integer >= physical, was: %r" % (logical,))

self._physical = physical
self._logical = logical
Expand Down

0 comments on commit 10f7f48

Please sign in to comment.