{"action":"created","issue":{"url":"https://api.github.com/repos/hylang/hy/issues/1449","repository_url":"https://api.github.com/repos/hylang/hy","labels_url":"https://api.github.com/repos/hylang/hy/issues/1449/labels{/name}","comments_url":"https://api.github.com/repos/hylang/hy/issues/1449/comments","events_url":"https://api.github.com/repos/hylang/hy/issues/1449/events","html_url":"https://github.com/hylang/hy/issues/1449","id":270301897,"number":1449,"title":"Multiple runs of `hy <file.hy>` give different results","user":{"login":"sleepyfox","id":512861,"avatar_url":"https://avatars3.githubusercontent.com/u/512861?v=4","gravatar_id":"","url":"https://api.github.com/users/sleepyfox","html_url":"https://github.com/sleepyfox","followers_url":"https://api.github.com/users/sleepyfox/followers","following_url":"https://api.github.com/users/sleepyfox/following{/other_user}","gists_url":"https://api.github.com/users/sleepyfox/gists{/gist_id}","starred_url":"https://api.github.com/users/sleepyfox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleepyfox/subscriptions","organizations_url":"https://api.github.com/users/sleepyfox/orgs","repos_url":"https://api.github.com/users/sleepyfox/repos","events_url":"https://api.github.com/users/sleepyfox/events{/privacy}","received_events_url":"https://api.github.com/users/sleepyfox/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-01T13:04:31Z","updated_at":"2017-11-01T14:34:39Z","closed_at":"2017-11-01T14:31:35Z","author_association":"NONE","body":"Using a simple test file:\r\n```\r\n(import unittest)\r\n(defclass test-string-methods [unittest.TestCase]\r\n  (defn test-upper [self]\r\n    (self.assertEqual (.upper \"foo\") \"FOO\")))                                                                                                                                           \r\n(unittest.main)\r\n```\r\nRunning hy test.hy the first time gives me the following error output:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/hy\", line 11, in <module>\r\n    load_entry_point('hy==0.13.0+141.ge0e8506', 'console_scripts', 'hy')()\r\n  File \"/usr/local/lib/python3.6/site-packages/hy/cmdline.py\", line 346, in hy_main\r\n    sys.exit(cmdline_handler(\"hy\", sys.argv))\r\n  File \"/usr/local/lib/python3.6/site-packages/hy/cmdline.py\", line 334, in cmdline_handler\r\n    return run_file(options.args[0])\r\n  File \"/usr/local/lib/python3.6/site-packages/hy/cmdline.py\", line 213, in run_file\r\n    pretty_error(import_file_to_module, \"__main__\", filename)\r\n  File \"/usr/local/lib/python3.6/site-packages/hy/cmdline.py\", line 186, in pretty_error\r\n    return func(*args, **kw)\r\n  File \"/usr/local/lib/python3.6/site-packages/hy/importer.py\", line 111, in import_file_to_module\r\n    eval(code, module.__dict__)\r\n  File \"test.hy\", line 8, in <module>\r\n    (unittest.main)\r\n  File \"/usr/local/lib/python3.6/unittest/main.py\", line 64, in __init__\r\n    self.module = __import__(module)\r\nModuleNotFoundError: import of __main__ halted; None in sys.modules\r\n```\r\nBut if I run `hy test.hy` a second time I get:\r\n```\r\n.\r\n----------------------------------------------------------------------\r\nRan 1 test in 0.000s\r\n\r\nOK\r\n```\r\nSubsequent runs work fine. If I delete `__pycache__` then the problem reappears. Using current hy from pip install:  0.13.0+141.ge0e8506"},"comment":{"url":"https://api.github.com/repos/hylang/hy/issues/comments/341123896","html_url":"https://github.com/hylang/hy/issues/1449#issuecomment-341123896","issue_url":"https://api.github.com/repos/hylang/hy/issues/1449","id":341123896,"user":{"login":"Kodiologist","id":322730,"avatar_url":"https://avatars3.githubusercontent.com/u/322730?v=4","gravatar_id":"","url":"https://api.github.com/users/Kodiologist","html_url":"https://github.com/Kodiologist","followers_url":"https://api.github.com/users/Kodiologist/followers","following_url":"https://api.github.com/users/Kodiologist/following{/other_user}","gists_url":"https://api.github.com/users/Kodiologist/gists{/gist_id}","starred_url":"https://api.github.com/users/Kodiologist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kodiologist/subscriptions","organizations_url":"https://api.github.com/users/Kodiologist/orgs","repos_url":"https://api.github.com/users/Kodiologist/repos","events_url":"https://api.github.com/users/Kodiologist/events{/privacy}","received_events_url":"https://api.github.com/users/Kodiologist/received_events","type":"User","site_admin":false},"created_at":"2017-11-01T14:34:39Z","updated_at":"2017-11-01T14:34:39Z","author_association":"MEMBER","body":"@kirbyfan64 So what you're saying is, `unittest.main` imports its calling module, triggering #1134?"}}
{"actor":{"display_login":"Kodiologist"}}