Re: glib-mkenums in glib 2



On Jan 1, 2013, at 8:11 PM, John Emmas <johne53 tiscali co uk> wrote:

> On 1 Jan 2013, at 15:54, John Emmas wrote:
> 
>> 
>> If anyone has a flash of inspiration, please let me know.
>> 
> 
> I had a flash of inspiration myself...
> 
>> 
>> Traceback (most recent call last):
>>   File "F:/+GTK-SOURCES/gnu-win32/src/glib/gio/gdbus-2.0/codegen/gdbus-codegen.in", line 39, in <module>
>>     from codegen import codegen_main
>>   File "F:\+GTK-SOURCES\gnu-win32\src\glib\gio\gdbus-2.0\codegen\codegen.py", line 26, in <module>
>>     from . import config
>> ValueError: Attempted relative import in non-package
>> 
> 
> Might this be a 'cascading' problem?  e.g. 'codegen' imports 'codegen_main' which (along the way) imports 'config' which fails - thereby causing them both to fail?
> 
> In other words, there might be nothing wrong in the 'codegen_main' package - except that something further down the line is failing to import 'config'

Well, yes, of course. In fact, there's a whole raft of cascading imports:
gdbus-codegen:
    from codegen import codegen_main
        from . import config
        from . import utils
        from . import dbustypes
            from . import utils
        from . import parser
            from . import dbustypes
        from . import codegen
            from . import config
            from . import utils
            from . import dbustypes
        from . import codegen_docbook 
            from . import config
            from . import utils
            from . import dbustypes
            from . import parser

What fails? codegen.py, halfway down the list.

Try renaming codegen.py to codegenerator.py and change the import statement in codegen_main.py.
Maybe it's a namespace issue.

Regards,
John Ralls



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]