nvda
ffbc2e6b - Allow NVDA to run even when nvda.pyw is imported by another Python script. This includes by the Python interpretor (i.e. python -c "import nvda")

Commit
17 years ago
Allow NVDA to run even when nvda.pyw is imported by another Python script. This includes by the Python interpretor (i.e. python -c "import nvda") *nvda.pyw: if not a frozen executable, change directory to nvda.pyw's directory, rather than changing directory to sys.path[0]. sys.path[0] can sometimes be '', or just completely wrong if nvda.pyw was not started as the top level Python script. *logHandler.makeModulePathFromFilePath: when splitting the last component off the given path, if it is '' then this is not useful as a module name, nore did split actually work, so break out of the loop. '' is given as the second part when split can not split any further. This change stops possible infinit loops. *logHandler.getCodePath: convert the co_filename string of the frame to a relative path when passing it to makeModulePathFromFilePath. When nvda was not started as the top-level script, this path for any other of NVDA's modules can be absolute, which is not too useful.
Parents
Loading