File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,16 +277,11 @@ namespace objects
277277
278278 object module_prefix ()
279279 {
280- object result (
280+ return object (
281281 PyObject_IsInstance (scope ().ptr (), upcast<PyObject>(&PyModule_Type))
282282 ? object (scope ().attr (" __name__" ))
283283 : api::getattr (scope (), " __module__" , str ())
284284 );
285-
286- if (result)
287- result += ' .' ;
288-
289- return result;
290285 }
291286
292287 namespace
@@ -348,11 +343,14 @@ namespace objects
348343
349344 // Call the class metatype to create a new class
350345 dict d;
351-
346+
347+ object m = module_prefix ();
348+ if (m) d[" __module__" ] = m;
349+
352350 if (doc != 0 )
353351 d[" __doc__" ] = doc;
354352
355- object result = object (class_metatype ())(module_prefix () + name, bases, d);
353+ object result = object (class_metatype ())(name, bases, d);
356354 assert (PyType_IsSubtype (result.ptr ()->ob_type , &PyType_Type));
357355
358356 if (scope ().ptr () != Py_None)
You can’t perform that action at this time.
0 commit comments