On 10-08-15 10:18, [email protected] wrote:
On Fri, Jul 31, 2015 at 12:00:15PM +0300, Mikko Rapeli wrote:
...
+# Check that path isn't a broken symlink
+def check_symlink(lnk):
+ if os.path.islink(lnk) and not os.path.exists(lnk):
+ return False
+ return True
- Bad coding style "if (x) return false".
- Naming a method "check..." suggests to me that it will raise an exception on
failure.
alternatives:
def is_broken_symlink(lnk):
return os.path.islink(lnk) and not os.path.exists(lnk)
def check_symlink(lnk, data):
if os.path.islink(lnk) and not os.path.exists(lnk):
raise_sanity_error("%s is a broken symlink." % lnk, data)
Kind regards,
Mike Looijmans
System Expert
TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
Telefax: +31 (0) 499 33 69 70
E-mail: [email protected]
Website: www.topicproducts.com
Please consider the environment before printing this e-mail
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core