1 |
commit: adf9ed1917ab33ff0db1b9646a7e174c8e3e9184 |
2 |
Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Oct 29 21:20:03 2019 +0000 |
4 |
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 29 21:20:53 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=adf9ed19 |
7 |
|
8 |
fix - check if xml file is empty |
9 |
|
10 |
Bug: https://bugs.gentoo.org/667590 |
11 |
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org> |
12 |
|
13 |
src/py/build-xml-rewrite | 3 ++- |
14 |
1 file changed, 2 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/src/py/build-xml-rewrite b/src/py/build-xml-rewrite |
17 |
index b449305..f839615 100755 |
18 |
--- a/src/py/build-xml-rewrite |
19 |
+++ b/src/py/build-xml-rewrite |
20 |
@@ -1,6 +1,6 @@ |
21 |
#!/usr/bin/env python3 |
22 |
|
23 |
-import sys |
24 |
+import sys, os |
25 |
import xml.etree.cElementTree as et |
26 |
from optparse import OptionParser |
27 |
|
28 |
@@ -32,6 +32,7 @@ def main(): |
29 |
gcp_sub = et.Element('classpath', path=gcp_str) |
30 |
|
31 |
for file in args: |
32 |
+ if os.path.getsize(file) == 0 : continue |
33 |
tree = et.ElementTree(file=file) |
34 |
if gcp or options.encoding: |
35 |
for javac in tree.getiterator('javac'): |