Changeset 1724
- Timestamp:
- 09/26/07 18:21:10
- Files:
-
- trunk/cherrypy/lib/__init__.py (modified) (1 diff)
- trunk/cherrypy/test/test_config.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/__init__.py
r1699 r1724 100 100 101 101 def build_Add(self, o): 102 real, imag = map(self.build_Const, o.getChildren()) 103 try: 104 real = float(real) 105 except TypeError: 106 raise TypeError("unrepr could not parse real %s" % repr(real)) 107 if not isinstance(imag, complex) or imag.real != 0.0: 108 raise TypeError("unrepr could not parse imag %s" % repr(imag)) 109 return real+imag 102 left, right = map(self.build, o.getChildren()) 103 return left + right 110 104 111 105 def build_Getattr(self, o): trunk/cherrypy/test/test_config.py
r1699 r1724 93 93 thing1: cherrypy.lib.http.response_codes[404] 94 94 thing2: __import__('cherrypy.tutorial', globals(), locals(), ['']).thing2 95 complex: 3+2j 96 ones: "11" 97 twos: "22" 98 stradd: %%(ones)s + %%(twos)s + "33" 95 99 96 100 [/favicon.ico] … … 170 174 from cherrypy.tutorial import thing2 171 175 self.assertBody(repr(thing2)) 176 177 self.getPage("/repr?key=complex") 178 self.assertBody("(3+2j)") 179 180 self.getPage("/repr?key=stradd") 181 self.assertBody(repr("112233")) 172 182 173 183 def testCustomNamespaces(self):

