Comments (2)
We seem to have a bunch of problems with dylink. Someone needs to clean
up this module...
On Fri, Jun 20, 2014 at 5:44 AM, aaaaalbert [email protected]
wrote:
dylink caches modules that have already been imported in (the same or
another) source file so that ciruclar imports don't become a problem, see
SeattleTestbed/seattlelib_v2#127
SeattleTestbed/seattlelib_v2#127. This works
as expected when running Repy, but fails under repyportability.Here's a test case that shows what happens. (I'll make a unit test out of
it too). testlib1 just defines an error class, which is imported and
raised in a function of testlib2, which in turn is called by the main
program, where we try to catch that exception.This is testlib1.r2py
class Lib1Error(Exception):
"""The exception we are trying to catch."""##################################
This is testlib2.r2py
lib1 = dy_import_module("testlib1.r2py")
def raise_lib1error():
raise lib1.Lib1Error################################
This is the main program
lib1 = dy_import_module("testlib1.r2py") # defines the exception
lib2 = dy_import_module("testlib2.r2py") # raises ittry:
lib2.raise_lib1error()
except lib1.Lib1Error:Branch taken in Rep
log("Could catch!\n")
except Exception, e:Branch taken under Repyportability
log("Nargh, caught", repr(e), "and not", repr(lib1.Lib1Error()))
To check the repyportability behavior, add this to the main program:
from repyportability import *
add_dy_support(locals())The issue is related to #27
#27 and possibly
Seattle's #1422, SeattleTestbed/seattlelib_v2#125
SeattleTestbed/seattlelib_v2#125,
SeattleTestbed/repy_v2#22
SeattleTestbed/repy_v2#22 (why's a RepyV2
issue btw?), and SeattleTestbed/repy_v2#55
SeattleTestbed/repy_v2#55.—
Reply to this email directly or view it on GitHub
#28.
from portability.
Two unit tests are available to check the behavior of the module cache now:
- SeattleTestbed/seattlelib_v2@8ae85a4 has a Repy version of the test, and shows the correct behavior (the imported exception can be caught)
- 61fd57e adds repyportability to the RepyV2 test, and exhibits the problem described above
from portability.
Related Issues (20)
- repyportability doesn't correctly map open / file... HOT 1
- Allow restrictions in programs using repyportability... HOT 2
- rephyhelper may have a path issue. HOT 1
- Misleading error message in repyhelper... HOT 1
- Translation error in sockettimeout.repy HOT 2
- repyhelper fails to import files from the current directory... HOT 1
- Problem with repyhelper + httpserver HOT 3
- Repy does not port to python properly in repy V2 HOT 1
- There has to be a way to run repy files thats using dynamic linking without restrictions. HOT 2
- advertise.repy throws error when using dylink_portability. HOT 1
- repyportability tests need to be ported to utf... HOT 1
- repyhelper only works when user has write access HOT 4
- Repyhelper cache corruption on SeattleOnAndroid HOT 1
- Repyportability in RepyV2 should allow us to import Repy files from pythonpath HOT 3
- repyportability utilizes repyhelper.translate_and_import to import dylink HOT 2
- dylink_import_module_symbols under repyportability violates Python import override conventions HOT 2
- `repyhelper` vs full disk?
- `repyportability` should not override Python builtins HOT 6
- Clean up repyportability!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from portability.