diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2023-10-09 17:22:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-09 08:22:27 -0700 |
commit | 82f1267486deb6fc7d1944ca0e5b7d77bbebb344 (patch) | |
tree | a5f52ca58ed9d36d3f63d57da9ca2566182dee6f /lib | |
parent | 19202b2528b68fc8958b25398081ddf8bff64119 (diff) | |
download | spack-82f1267486deb6fc7d1944ca0e5b7d77bbebb344.tar.gz spack-82f1267486deb6fc7d1944ca0e5b7d77bbebb344.tar.bz2 spack-82f1267486deb6fc7d1944ca0e5b7d77bbebb344.tar.xz spack-82f1267486deb6fc7d1944ca0e5b7d77bbebb344.zip |
unparse: drop python 3.3 remnants (#40331)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/util/unparse/unparser.py | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/lib/spack/spack/util/unparse/unparser.py b/lib/spack/spack/util/unparse/unparser.py index 375fb543a3..932ab8d020 100644 --- a/lib/spack/spack/util/unparse/unparser.py +++ b/lib/spack/spack/util/unparse/unparser.py @@ -938,16 +938,10 @@ class Unparser: self.write(", ") self.write("*") if node.vararg: - if hasattr(node.vararg, "arg"): - self.write(node.vararg.arg) - if node.vararg.annotation: - self.write(": ") - self.dispatch(node.vararg.annotation) - else: - self.write(node.vararg) - if getattr(node, "varargannotation", None): - self.write(": ") - self.dispatch(node.varargannotation) + self.write(node.vararg.arg) + if node.vararg.annotation: + self.write(": ") + self.dispatch(node.vararg.annotation) # keyword-only arguments if getattr(node, "kwonlyargs", False): @@ -967,16 +961,10 @@ class Unparser: first = False else: self.write(", ") - if hasattr(node.kwarg, "arg"): - self.write("**" + node.kwarg.arg) - if node.kwarg.annotation: - self.write(": ") - self.dispatch(node.kwarg.annotation) - else: - self.write("**" + node.kwarg) - if getattr(node, "kwargannotation", None): - self.write(": ") - self.dispatch(node.kwargannotation) + self.write("**" + node.kwarg.arg) + if node.kwarg.annotation: + self.write(": ") + self.dispatch(node.kwarg.annotation) def visit_keyword(self, node): if node.arg is None: |