diff options
| author | Graham Higgins <gjhiggins@users.noreply.github.com> | 2022-05-25 19:13:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-25 20:13:12 +0200 |
| commit | 685dec599d148bf2e43e1ec116e17dbeffc2b1a3 (patch) | |
| tree | e58634a22cdb41dac7b0d5bc8805008d6be33c50 /rdflib/plugins/serializers/xmlwriter.py | |
| parent | 32979d1fc857769257b6cc9eec550253da1b8681 (diff) | |
| download | rdflib-685dec599d148bf2e43e1ec116e17dbeffc2b1a3.tar.gz | |
fix sonarcloud-reported bug in xmlwriter, add test (#1951)
sonarcloud detected a bug: “Remove 1 unexpected arguments; 'join' expects 1 positional arguments.” in xmlwriter:
```py
return ":".join(pre, uri[len(ns) :])
```
Added containing brackets apparently omitted by original author.
```py
return ":".join([pre, uri[len(ns) :]])
```
Added test for surety, took the opportunity of adding two tests to take coverage of `xmlwriter` to 100%.
Diffstat (limited to 'rdflib/plugins/serializers/xmlwriter.py')
| -rw-r--r-- | rdflib/plugins/serializers/xmlwriter.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rdflib/plugins/serializers/xmlwriter.py b/rdflib/plugins/serializers/xmlwriter.py index 7a4be155..9ed10f48 100644 --- a/rdflib/plugins/serializers/xmlwriter.py +++ b/rdflib/plugins/serializers/xmlwriter.py @@ -100,7 +100,7 @@ class XMLWriter(object): for pre, ns in self.extra_ns.items(): if uri.startswith(ns): if pre != "": - return ":".join(pre, uri[len(ns) :]) + return ":".join([pre, uri[len(ns) :]]) else: return uri[len(ns) :] |
