{"action":"created","issue":{"url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/235","labels_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/235/comments","events_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/235/events","html_url":"https://github.com/unicorn-engine/unicorn/issues/235","id":114471064,"number":235,"title":"python bindings should use package-relative imports","user":{"login":"williballenthin","id":156560,"avatar_url":"https://avatars.githubusercontent.com/u/156560?v=3","gravatar_id":"","url":"https://api.github.com/users/williballenthin","html_url":"https://github.com/williballenthin","followers_url":"https://api.github.com/users/williballenthin/followers","following_url":"https://api.github.com/users/williballenthin/following{/other_user}","gists_url":"https://api.github.com/users/williballenthin/gists{/gist_id}","starred_url":"https://api.github.com/users/williballenthin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williballenthin/subscriptions","organizations_url":"https://api.github.com/users/williballenthin/orgs","repos_url":"https://api.github.com/users/williballenthin/repos","events_url":"https://api.github.com/users/williballenthin/events{/privacy}","received_events_url":"https://api.github.com/users/williballenthin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-01T14:01:32Z","updated_at":"2015-11-01T14:37:22Z","closed_at":null,"body":"To support Python3 bindings, the Unicorn binding source files should use package-relative imports.\r\n\r\n```\r\n[willi@hostname python]$ python\r\nPython 3.5.0 (default, Sep 20 2015, 11:28:25) \r\n[GCC 5.2.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import unicorn\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/usr/lib/python3.5/site-packages/unicorn/__init__.py\", line 3, in <module>\r\n    from unicorn_const import *\r\nImportError: No module named 'unicorn_const'\r\n```\r\n\r\nEssentially the fix is:\r\n\r\n```\r\n-from unicorn_const import *\r\n+from .unicorn_const import *\r\n```\r\n\r\nThis should also work on Python2, so no change to existing Python2 users' behavior.\r\n\r\nI'll submit a PR to fix this issue, probably today. Opened this issue not to request support, but coordinate/share ideas."},"comment":{"url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/comments/152830620","html_url":"https://github.com/unicorn-engine/unicorn/issues/235#issuecomment-152830620","issue_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/235","id":152830620,"user":{"login":"aquynh","id":5965536,"avatar_url":"https://avatars.githubusercontent.com/u/5965536?v=3","gravatar_id":"","url":"https://api.github.com/users/aquynh","html_url":"https://github.com/aquynh","followers_url":"https://api.github.com/users/aquynh/followers","following_url":"https://api.github.com/users/aquynh/following{/other_user}","gists_url":"https://api.github.com/users/aquynh/gists{/gist_id}","starred_url":"https://api.github.com/users/aquynh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aquynh/subscriptions","organizations_url":"https://api.github.com/users/aquynh/orgs","repos_url":"https://api.github.com/users/aquynh/repos","events_url":"https://api.github.com/users/aquynh/events{/privacy}","received_events_url":"https://api.github.com/users/aquynh/received_events","type":"User","site_admin":false},"created_at":"2015-11-01T14:37:22Z","updated_at":"2015-11-01T14:37:22Z","body":"great, look forward to your PR. thanks"}}