summaryrefslogtreecommitdiff
path: root/pokemontools/graph.py
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-02-13 18:09:31 -0500
committerGitHub <noreply@github.com>2017-02-13 18:09:31 -0500
commit979c98a7c0f67ad6b9685b2d532c66a1f76ffb22 (patch)
treec67cc7b8500aac4e400d4e8bfdbef57a57b63eb1 /pokemontools/graph.py
parent74c620d01ad59bfb09cf4111ace549b925fcb9ab (diff)
parent766dea11bd63dee939db2b47198410e6c6e0fc7e (diff)
Merge pull request #103 from eevee/py3
Python 3 compatibility, sort of, maybe
Diffstat (limited to 'pokemontools/graph.py')
-rw-r--r--pokemontools/graph.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pokemontools/graph.py b/pokemontools/graph.py
index 47087e5..a639ca0 100644
--- a/pokemontools/graph.py
+++ b/pokemontools/graph.py
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
+from __future__ import print_function
+from __future__ import absolute_import
import networkx as nx
-from romstr import (
+from .romstr import (
RomStr,
relative_jumps,
call_commands,
@@ -92,7 +94,7 @@ class RomGraph(nx.DiGraph):
# check if there are any nops (probably not a function)
nops = 0
for (id, command) in func.asm_commands.items():
- if command.has_key("id") and command["id"] == 0x0:
+ if "id" in command and command["id"] == 0x0:
nops += 1
# skip this function
@@ -131,7 +133,7 @@ class RomGraph(nx.DiGraph):
Shows some text output describing which nodes point to which other
nodes.
"""
- print self.edges()
+ print(self.edges())
def to_d3(self):
"""