[pypy-dev] Config value owner

anatoly techtonik techtonik at gmail.com
Mon Dec 24 18:31:45 CET 2012


On Mon, Dec 24, 2012 at 2:18 PM, Maciej Fijalkowski <fijall at gmail.com> wrote:

On Mon, Dec 24, 2012 at 1:16 PM, anatoly techtonik <techtonik at gmail.com>
> wrote:
> > What is the meaning of value owner in Config class? It prevents useful
> > debugging output from displaying (like --help option, which doesn't work
> for
> > translator.py on my machine due to missing compiler traceback).
> >
> >
> https://bitbucket.org/pypy/pypy/src/36abd0dd07d468456e1acb2565f0b59979ed1445/pypy/config/config.py?at=default#cl-189
>
> Hi Anatoly.
>
> If you want real time feedback on such questions, I suggest you come

to #pypy on IRC. I seriously don't understand the question though.
>

I am trying to read help for rpython cli utility.

> pypy\translator\goal\translate.py --help
[platform:error] Could not find a Microsoft Compiler
[platform:error] Could not find a Microsoft Compiler
[platform:msg] Set platform with 'host' cc=None, using cc='cl.exe'
[translation:info] Translating target as defined by targetpypystandalone
[platform:execute] cl.exe /nologo /c /MD /O2
/Foc:\users\anatoli\appdata\local\temp\usession-default-31\gcctest.obj
c:\users\ana
toli\appdata\local\temp\usession-default-31\gcctest.c
Traceback (most recent call last):
  File "translate.py", line 326, in <module>
    main()
  File "translate.py", line 211, in main
    targetspec_dic, translateconfig, config, args =
parse_options_and_load_target()
...


I tried to debug why the --help option doesn't work and the utility starts
translating. The options stuff is interwined with pypy.config.config.Config
object. If you try to print the value of this object in
pypy\pypy\translator\goal\translate.py:parse_options_and_load_target you'll
get just one line:
[translate]

If you comment the block marked by the link above, which is:
            if self._cfgimpl_value_owners.get(name, None) == 'default':
                continue

Then the output is an indented tree that includes the value of help option
I was looking for. So, the question is what the check
with _cfgimpl_value_owners is for?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20121224/059b7937/attachment.html>


More information about the pypy-dev mailing list