where to put global testing value

R

Robin Becker

A user complains that under AppEngine I'm not allowed to import __main__.

I can fix this issue merely by putting a try block around the offending import
which is only used like this


import __main__
testing = getattr(__main__,'_rl_testing',False)
del __main__

this is only used as a hack way, during testing, to modify the behaviour of the
importing module (a proxy for a C extension). During testing we keep both the C
version and the supposed replacement of various functions so they can be tested
against each other

https://bitbucket.org/rptlab/reportlab/src/default/src/reportlab/lib/rl_accel.py

Is there a more reasonable way to allow changes to module level globals before
the import takes place? I guess since this module is supposed only to be
imported by reportlab we can put this sort of thing onto the reportlab module
itself, but that could possibly lead to import loops.

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,955
Messages
2,570,117
Members
46,705
Latest member
v_darius

Latest Threads

Top