diff --git a/angr/analyses/disassembly.py b/angr/analyses/disassembly.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/disassembly.py
+++ b/angr/analyses/disassembly.py
@@ -572,9 +572,8 @@ class Disassembly(Analysis):
         self._func_cache = {}
 
         if function is not None:
-            blocks = function.graph.nodes()
             # sort them by address, put hooks before nonhooks
-            blocks.sort(key=lambda node: (node.addr, not node.is_hook))
+            blocks = sorted(function.graph.nodes(), key=lambda node: (node.addr, not node.is_hook))
             for block in blocks:
                 self.parse_block(block)
Disassembly: Fix for NetworkX 2.