Display the name not the group itself
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index 662e49a..0a361ab 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -621,7 +621,7 @@
                     if isname(condname):
                         condgroup = state.groupdict.get(condname)
                         if condgroup is None:
-                            msg = "unknown group name: {0!r}".format(condgroup)
+                            msg = "unknown group name: {0!r}".format(condname)
                             raise error(msg)
                     else:
                         try: