Skip to content

Commit

Permalink
LazyImporter now supplies a __file__ attribute (defaults to None). Fi…
Browse files Browse the repository at this point in the history
…xes #147

git-svn-id: https://svn.pyamf.org/pyamf/trunk@724 2dde4cc4-cf3c-0410-b1a3-a9b8ff274da5
  • Loading branch information
njoyce committed Jan 2, 2008
1 parent 7d7f502 commit e4d0858
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.txt
Expand Up @@ -8,6 +8,9 @@ of PyAMF.
0.1.0b (unreleased)
-------------------

- LazyImporter objects now set the __file__ attribute to None, so that
querying sys.modules don't accidentally import the underlying module.
(Ticket:147)
- Fixed argument positioning for RemoteObject processing. Thanks akaihola!
(Ticket:145)
- Added tests for TwistedGateway (Ticket:132)
Expand Down
3 changes: 2 additions & 1 deletion pyamf/remoting/gateway.py
Expand Up @@ -328,6 +328,7 @@ class LazyImporter(object):

def __init__(self, module_name):
self.__name__ = module_name
self.__file__ = None

def __getattr__(self, name):
full_import_name = '%s.%s' % (LazyImporter.module, self.__name__)
Expand All @@ -336,7 +337,7 @@ def __getattr__(self, name):
setattr(sys.modules[LazyImporter.module], self.__name__, mod)

self.__dict__.update(mod.__dict__)

return getattr(mod, name)

for f in glob(os.path.join(os.path.dirname(thismodule[1].__file__), '*gateway.py')):
Expand Down

0 comments on commit e4d0858

Please sign in to comment.