[Scons-users] Issue with dill
Albert Arquer
albert.arquer at gmail.com
Thu Nov 24 15:46:40 EST 2016
Hello Dirk,
The files you are asking for are extremelly large.. I can give you the
modules that I actually import in GenericModule.py:
import os, glob, sys
from SCons.Builder import Builder
from SCons.Builder import is_a_Builder
from SCons.Defaults import Copy
from SCons.Script import AddOption, GetOption, Main, Help
from SCons.Variables import *
from datetime import timedelta
from Functions import *
import SharedObjects
import HDLEnvironment
import inspect
import imp
import datetime
import binascii
import hashlib
import pickle
#import dill
import argparse
SConstruct_new just imports GenericModule and then calls a function from
it, which basically imports a certain python module which is actually the
one that by instanciating a class (lets say GenericTarget) actually
declares all the targets..
The wierd thing is that if I run a python shell, and then I try to import
all those modules with the "import dill" uncommented, the same crash
happens, however if I move the dill package up to the top, the shell does
not complain and all packages seem to be imported.
I thought this would fix my problem so I went and moved dill up to the top
on my GenericModule.py, however, for some reason, python still crashes when
called through scons...
2016-11-24 20:51 GMT+01:00 Dirk Bächle <tshortik at gmx.de>:
> Hi Albert,
>
> On 24.11.2016 17:24, Albert Arquer wrote:
>
>> Hello,
>>
>> I have been trying to do some tricky stuff with scons in order to be able
>> to detect subtle changes that where not original picked up
>> by scons. Long story short, I think I found a way with the dill package.
>>
>> I have installed dill and while I can import it into a normal python
>> shell or include it in a normal python script, when I import it
>> from my sconstruct I get:
>>
>> scons: Reading SConscript files ...
>> AttributeError: 'builtin_function_or_method' object has no attribute
>> 'dispatch':
>> File ".../SConstruct_new", line 2:
>> from GenericModule import *
>> File ".../GenericModule.py", line 20:
>> import dill
>> File ".../python/2.7.8/lib/python2.7/site-packages/dill-0.2.5-py2.7.egg/dill/__init__.py",
>> line 26:
>> from .dill import dump, dumps, load, loads, dump_session,
>> load_session, \
>> File ".../python/2.7.8/lib/python2.7/site-packages/dill-0.2.5-py2.7.egg/dill/dill.py",
>> line 371:
>> class Pickler(StockPickler):
>> File ".../python/2.7.8/lib/python2.7/site-packages/dill-0.2.5-py2.7.egg/dill/dill.py",
>> line 373:
>> dispatch = MetaCatchingDict(StockPickler.dispatch.copy())
>>
>>
>> I have read somewhere about an environment variable called
>> SCONS_HORRIBLE_REGRESSION_TEST_HACK, while I have no idea what that does,
>> I have tried it and it still fails...
>>
>> I really need dill... what can I do?
>>
>>
> for a start, you could show us the full (and verbatim) contents of your
> "SConstruct_new" and "GenericModule.py" files. It's important to see which
> other modules you try to import...SCons is doing some wrapping around
> cPickle where needed, and the exact order in which things are initialized
> will probably make a difference.
>
> I guess you already found
>
> http://scons-users.scons.narkive.com/vqa4FUWi/scons-not-
> playing-well-with-scipy
>
> while "searching the web"? Is that where you have the variable name
> SCONS_HORRIBLE_REGRESSION_TEST_HACK from?
>
> Best regards,
>
> Dirk
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20161124/82c34a8b/attachment.html>
More information about the Scons-users
mailing list