diff --git a/scripts/issues.py b/scripts/issues.py
index <HASH>..<HASH> 100755
--- a/scripts/issues.py
+++ b/scripts/issues.py
@@ -283,7 +283,7 @@ def issue_line(issue):
 def generate_changelog(issues, after, heading, rtag=False):
     """Prints out changelog."""
     relevent = relevant_issues(issues, after)
-    relevent = sorted(relevent, key=ISSUES_SORT_KEY)
+    relevent = sorted(relevent, key=ISSUES_BY_SECTION)
 
     def write(func, endofline="", append=""):
         func(heading + '\n' + '-' * 20 + endofline)
Fix sorting in py3 using the proper key.