chiark / gitweb /
Do not assert when a firmware file is not found.
authordaid <daid303@gmail.com>
Fri, 31 Oct 2014 13:39:01 +0000 (14:39 +0100)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Wed, 14 Jan 2015 17:14:28 +0000 (12:14 -0500)
Cura/util/resources.py

index 6c38576398db5a26d5685c99301e0e12b465632f..59592fb173f210f83ed25536e8057deffd0543ea 100644 (file)
@@ -32,7 +32,8 @@ else:
 def getPathForResource(dir, subdir, resource_name):
        assert os.path.isdir(dir), "{p} is not a directory".format(p=dir)
        path = os.path.normpath(os.path.join(dir, subdir, resource_name))
-       assert os.path.isfile(path), "{p} is not a file.".format(p=path)
+       if not os.path.isfile(path):
+               return None
        return path
 
 def getPathForImage(name):