Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from protonfixes import debug fails #160

Closed
bmaupin opened this issue Jul 23, 2021 · 1 comment · Fixed by #167
Closed

from protonfixes import debug fails #160

bmaupin opened this issue Jul 23, 2021 · 1 comment · Fixed by #167
Assignees

Comments

@bmaupin
Copy link
Contributor

bmaupin commented Jul 23, 2021

As I mentioned in #159, from protonfixes import debug is silently failing.

If I import it manually then I can see the error:

$ cd ~/.config/protonfixes
$ python3

>>> import os
>>> import sys
>>> from importlib import import_module
>>> 
>>> gameid = '63600'
>>> sys.path.append(os.path.expanduser('~/.config/protonfixes'))
>>> game_module = import_module('localfixes.' + gameid)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/user/.config/protonfixes/localfixes/63600.py", line 5, in <module>
    from protonfixes import debug
  File "/usr/local/lib/python3.8/dist-packages/protonfixes/debug.py", line 8, in <module>
    from __main__ import CURRENT_PREFIX_VERSION, basedir
ImportError: cannot import name 'CURRENT_PREFIX_VERSION' from '__main__' (unknown location)

If I comment out that one line, the other imports seem to work fine, e.g.

from protonfixes import util
from protonfixes.logger import log

So I think protonfixes is installed correctly (I installed it using sudo pip3 install protonfixes).

Thanks!

@bmaupin
Copy link
Contributor Author

bmaupin commented Jul 24, 2021

I just realized that I added from protonfixes import debug in the wrong file ... I only happened to see in https://github.com/simons-public/protonfixes/wiki/Proton-user_settings.py-examples that I'm supposed to add it to user_settings.py whereas I'd added it to my game fix.

Do you think https://github.com/simons-public/protonfixes/wiki/Writing-Gamefixes could be updated to specifically mention the file where from protonfixes import debug supposed to be added? I guess there's no way to submit a PR for a wiki or I'd submit one myself.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants