FHPythonUtils / GetOSTheme

Use this module to get the OS theme (dark/light)
Other
1 stars 0 forks source link

Bug: `AttributeError: module 'ctypes' has no attribute 'util'` in getostheme/__init__.py, line 16, in isLightMode_Mac #1

Closed twardoch closed 4 years ago

twardoch commented 4 years ago

Bug

System info

Describe the bug

When using the https://github.com/FHPythonUtils/Cli2Gui package, I get this traceback:

traceback (most recent call last):
  File "__main__.py", line 286, in <module>
  File "__main__.py", line 279, in main
  File "/Users/adam/Library/Python/3.8/lib/python/site-packages/cli2gui/decorators.py", line 194, in run_cli2gui
  File "/Users/adam/Library/Python/3.8/lib/python/site-packages/cli2gui/application/application.py", line 237, in run
  File "/Users/adam/Library/Python/3.8/lib/python/site-packages/cli2gui/application/application.py", line 60, in setBase24Theme
  File "/Users/adam/Library/Python/3.8/lib/python/site-packages/getostheme/__init__.py", line 122, in isDarkMode
  File "/Users/adam/Library/Python/3.8/lib/python/site-packages/getostheme/__init__.py", line 109, in isLightMode
  File "/Users/adam/Library/Python/3.8/lib/python/site-packages/getostheme/__init__.py", line 16, in isLightMode_Mac
AttributeError: module 'ctypes' has no attribute 'util'

The reason for this is that import ctypes does not import ctypes.util by default anymore in newest Py. Therefore after import ctypes there should be an extra line import ctypes.util

FredHappyface commented 4 years ago

Thanks for the report! I'll get that fixed

FredHappyface commented 4 years ago

Could you update this to 2020.3.2 and see if that's fixed it? (Unfortunately I lack a Mac to test)

Do let me know if you have any further issues and I'll take a look 😄

FredHappyface commented 4 years ago

I'm going to assume that the fix works. Thanks again for dropping the issue

(feel free to reopen if you need to)