Changeset 1699
- Timestamp:
- 07/21/07 12:24:26
- Files:
-
- trunk/cherrypy/lib/__init__.py (modified) (2 diffs)
- trunk/cherrypy/test/test_config.py (modified) (2 diffs)
- trunk/cherrypy/tutorial/__init__.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/__init__.py
r1620 r1699 46 46 return m(o) 47 47 48 def build_Subscript(self, o): 49 expr, flags, subs = o.getChildren() 50 expr = self.build(expr) 51 subs = self.build(subs) 52 return expr[subs] 53 48 54 def build_CallFunc(self, o): 49 55 children = map(self.build, o.getChildren()) … … 82 88 return modules(o.name) 83 89 except ImportError: 90 pass 91 92 # See if the Name is in __builtin__. 93 try: 94 import __builtin__ 95 return getattr(__builtin__, o.name) 96 except AttributeError: 84 97 pass 85 98 trunk/cherrypy/test/test_config.py
r1698 r1699 91 91 neg: -1234 92 92 filename: os.path.join(sys.prefix, "hello.py") 93 thing1: cherrypy.lib.http.response_codes[404] 94 thing2: __import__('cherrypy.tutorial', globals(), locals(), ['']).thing2 93 95 94 96 [/favicon.ico] … … 161 163 self.getPage("/repr?key=filename") 162 164 self.assertBody(repr(os.path.join(sys.prefix, "hello.py"))) 165 166 self.getPage("/repr?key=thing1") 167 self.assertBody(repr(cherrypy.lib.http.response_codes[404])) 168 169 self.getPage("/repr?key=thing2") 170 from cherrypy.tutorial import thing2 171 self.assertBody(repr(thing2)) 163 172 164 173 def testCustomNamespaces(self): trunk/cherrypy/tutorial/__init__.py
r762 r1699 1 2 # This is used in test_config to test unrepr of "from A import B" 3 thing2 = object()

