cmu-cs-academy / desktop-cmu-graphics

BSD 3-Clause "New" or "Revised" License
15 stars 9 forks source link

cmu_graphics throws an error when you try to import it from a repl #68

Closed austin-schick closed 3 months ago

austin-schick commented 3 months ago
Python 3.11.1 (v3.11.1:a7a450f84a, Dec  6 2022, 15:24:06) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import cmu_graphics

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cmu_graphics/__init__.py", line 4, in <module>

    main_directory = os.path.dirname(__main__.__file__)

                                     ^^^^^^^^^^^^^^^^^

AttributeError: module '__main__' has no attribute '__file__'. Did you mean: '__name__'?

Ideally, this would "just work" the way you'd expect.