Browse Source

fix a warning in keil.py

Fix the warning:

E:\projects\rt-thread\rtthread-svn\trunk\tools\keil.py:72: FutureWarning: The behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.
  if not groups:

See http://docs.python.org/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.remove for detail.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2226 bbd45198-f89e-11dd-88c7-29a3b14d5316
chaos.proton@gmail.com 13 years ago
parent
commit
0b1f748701
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tools/keil.py

+ 1 - 1
tools/keil.py

@@ -69,7 +69,7 @@ def MDK4Project(target, script):
     
     # add group
     groups = tree.find('Targets/Target/Groups')
-    if not groups:
+    if groups is None:
         groups = SubElement(tree.find('Targets/Target'), 'Groups')
     for group in script:
         group_xml = MDK4AddGroup(ProjectFiles, groups, group['name'], group['src'], project_path)