mbuesch / razer

Razer device library and tools
http://bues.ch/h/razercfg
GNU General Public License v2.0
250 stars 50 forks source link

Add the working directory to sys.path to fix out-of-tree builds #126

Closed z3ntu closed 5 years ago

z3ntu commented 5 years ago

Fixes #125

mbuesch commented 5 years ago

The commit message is not correct. The problem is that cwd apparently does not show up in PYTHONPATH for some unknown reason. Of course having an installed pyrazer would mask the problem. But there certainly are systems where an install succeeds, even if there is no installed pyrazer.

Please just write something like: Add the working directory to PYTHONPATH instead of implicitly relying on that being the default

z3ntu commented 5 years ago

As initialized upon program startup, the first item of this list, path[0], is the directory containing the script that was used to invoke the Python interpreter. If the script directory is not available (e.g. if the interpreter is invoked interactively or if the script is read from standard input), path[0] is the empty string, which directs Python to search modules in the current directory first.

mbuesch commented 5 years ago

Ok, but that's not related. The problem is cwd, not the script path. Can we have a changed commit message, please?

z3ntu commented 5 years ago

I think this commit message described the problem+solution most appropriately.