| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a9b0074 commit ba61f42
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -129,10 +129,14 @@ private static ClassBase CreateClass(Type type) { | |||
| 129 | 129 | // If class has constructors, generate an __doc__ attribute. | |
| 130 | 130 | ||
| 131 | 131 | ClassObject co = impl as ClassObject; | |
| 132 | + // If this is a ClassObject AND it has constructors, generate a __doc__ attribute. | ||
| 133 | + // required that the ClassObject.ctors be changed to internal | ||
| 132 | 134 | if (co != null) { | |
| 133 | - IntPtr doc = co.GetDocString(); | ||
| 134 | - Runtime.PyDict_SetItemString(dict, "__doc__", doc); | ||
| 135 | - Runtime.Decref(doc); | ||
| 135 | + if (co.ctors.Length > 0) { | ||
| 136 | + IntPtr doc = co.GetDocString(); | ||
| 137 | + Runtime.PyDict_SetItemString(dict, "__doc__", doc); | ||
| 138 | + Runtime.Decref(doc); | ||
| 139 | + } | ||
| 136 | 140 | } | |
| 137 | 141 | ||
| 138 | 142 | return impl; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,8 +21,8 @@ namespace Python.Runtime { | |||
| 21 | 21 | ||
| 22 | 22 | internal class ClassObject : ClassBase { | |
| 23 | 23 | ||
| 24 | - ConstructorBinder binder; | ||
| 25 | - ConstructorInfo[] ctors; | ||
| 24 | + internal ConstructorBinder binder; | ||
| 25 | + internal ConstructorInfo[] ctors; | ||
| 26 | 26 | ||
| 27 | 27 | internal ClassObject(Type tp) : base(tp) { | |
| 28 | 28 | ctors = type.GetConstructors(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ def testEnumStandardAttrs(self): | |||
| 20 | 20 | self.failUnless(DayOfWeek.__name__ == 'DayOfWeek') | |
| 21 | 21 | self.failUnless(DayOfWeek.__module__ == 'System') | |
| 22 | 22 | self.failUnless(type(DayOfWeek.__dict__) == types.DictProxyType) | |
| 23 | - self.failUnless(DayOfWeek.__doc__ == '') | ||
| 23 | + self.failUnless(DayOfWeek.__doc__ == None) | ||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | def testEnumGetMember(self): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments