[mozinstall] is_installer() should not assert if src is a file but return a boolean value

RESOLVED FIXED

Status

Testing
Mozbase
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: whimboo, Assigned: whimboo)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Right now we assert that the src is a file. This is kinda bad because this function is intended to return a boolean value and not to throw an exception.

assert os.path.isfile(src), 'Installer has to be a file'

Instead we should return false if src is not a file.
Created attachment 637614 [details]
Patch

Pointer to Github pull-request
Attachment #637614 - Attachment description: Pointer to Github pull request: https://github.com/mozilla/mozbase/pull/23 → Patch
Attachment #637614 - Flags: review?(jhammel)

Comment 2

6 years ago
Comment on attachment 637614 [details]
Patch

sounds good to me
Attachment #637614 - Flags: review?(jhammel) → review+
https://github.com/mozilla/mozbase/commit/4f024605b1630003c804096c53a930a761510cd6

I will also bump the version of mozinstall and release on pypi so we can make use of it in our mozmill-automation package.
Version bump to 1.1:
https://github.com/mozilla/mozbase/commit/588c89e8a3f259413d08f58747a17a0c7b22ae2d

Created tag:
https://github.com/mozilla/mozbase/tree/mozinstall-1.1

Release 1.1 on PyPI:
http://pypi.python.org/pypi/mozInstall/1.1
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.