Re: [PATCH] Fix super().__init__ call on python2.6
I don't know Python very well. Petar, can you verify this is correct? (I tried it and the tests still pass.) On Thu, Nov 6, 2008 at 11:43 PM, Pavel Shramov [EMAIL PROTECTED] wrote: In 2.4, 2.5 and 2.6 superclass constructor call don't need self as first arg but 2.6 raises error if it's given. --- python/google/protobuf/reflection.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/python/google/protobuf/reflection.py b/python/google/protobuf/reflection.py index d80942e..25dd04b 100755 --- a/python/google/protobuf/reflection.py +++ b/python/google/protobuf/reflection.py @@ -152,7 +152,7 @@ class GeneratedProtocolMessageType(type): _AddMessageMethods(descriptor, cls) _AddPrivateHelperMethods(cls) superclass = super(GeneratedProtocolMessageType, cls) -superclass.__init__(cls, name, bases, dictionary) +superclass.__init__(name, bases, dictionary) # Stateless helpers for GeneratedProtocolMessageType below. -- 1.5.6.5 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---
Re: [PATCH] Fix super().__init__ call on python2.6
On Fri, Nov 07, 2008 at 10:04:27AM -0800, Kenton Varda wrote: I don't know Python very well. Petar, can you verify this is correct? (I tried it and the tests still pass.) Problem is raising both in tests and in real applications. Both svn trunk and 2.0.2 version fail (will be strange if one won't) If it's interesting, system was FreeBSD 7.0 in KVM Test log included in the end of the message (it's pretty straightforward): Pavel Test log: [EMAIL PROTECTED] ~/protobuf/python]$ python2.6 ./setup.py test running test running egg_info writing protobuf.egg-info/PKG-INFO writing namespace_packages to protobuf.egg-info/namespace_packages.txt writing top-level names to protobuf.egg-info/top_level.txt writing dependency_links to protobuf.egg-info/dependency_links.txt reading manifest file 'protobuf.egg-info/SOURCES.txt' writing manifest file 'protobuf.egg-info/SOURCES.txt' running build_ext Traceback (most recent call last): File ./setup.py, line 131, in module Protocol Buffers are Google's data interchange format., File /usr/local/lib/python2.6/distutils/core.py, line 152, in setup dist.run_commands() File /usr/local/lib/python2.6/distutils/dist.py, line 975, in run_commands self.run_command(cmd) File /usr/local/lib/python2.6/distutils/dist.py, line 995, in run_command cmd_obj.run() File build/bdist.freebsd-7.0-RELEASE-i386/egg/setuptools/command/test.py, line 121, in run File build/bdist.freebsd-7.0-RELEASE-i386/egg/setuptools/command/test.py, line 101, in with_project_on_sys_path File build/bdist.freebsd-7.0-RELEASE-i386/egg/setuptools/command/test.py, line 130, in run_tests File /usr/local/lib/python2.6/unittest.py, line 816, in __init__ self.parseArgs(argv) File /usr/local/lib/python2.6/unittest.py, line 843, in parseArgs self.createTests() File /usr/local/lib/python2.6/unittest.py, line 849, in createTests self.module) File /usr/local/lib/python2.6/unittest.py, line 613, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File /usr/local/lib/python2.6/unittest.py, line 598, in loadTestsFromName test = obj() File /usr/home/psha/protobuf/python/setup.py, line 62, in MakeTestSuite import google.protobuf.internal.generator_test as generator_test File /usr/home/psha/protobuf/python/google/protobuf/internal/generator_test.py, line 43, in module from google.protobuf import unittest_mset_pb2 File /usr/home/psha/protobuf/python/google/protobuf/unittest_mset_pb2.py, line 9, in module from google.protobuf import descriptor_pb2 File /usr/home/psha/protobuf/python/google/protobuf/descriptor_pb2.py, line 879, in module class FileDescriptorSet(message.Message): File /usr/home/psha/protobuf/python/google/protobuf/reflection.py, line 155, in __init__ superclass.__init__(cls, name, bases, dictionary) TypeError: Error when calling the metaclass bases type.__init__() takes 1 or 3 arguments --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---
Re: [PATCH] Fix super().__init__ call on python2.6
Yes, I believe you. We just have a policy of reviewing all changes. :) On Fri, Nov 7, 2008 at 11:19 AM, Pavel Shramov [EMAIL PROTECTED] wrote: On Fri, Nov 07, 2008 at 10:04:27AM -0800, Kenton Varda wrote: I don't know Python very well. Petar, can you verify this is correct? (I tried it and the tests still pass.) Problem is raising both in tests and in real applications. Both svn trunk and 2.0.2 version fail (will be strange if one won't) If it's interesting, system was FreeBSD 7.0 in KVM Test log included in the end of the message (it's pretty straightforward): Pavel Test log: [EMAIL PROTECTED] ~/protobuf/python]$ python2.6 ./setup.py test running test running egg_info writing protobuf.egg-info/PKG-INFO writing namespace_packages to protobuf.egg-info/namespace_packages.txt writing top-level names to protobuf.egg-info/top_level.txt writing dependency_links to protobuf.egg-info/dependency_links.txt reading manifest file 'protobuf.egg-info/SOURCES.txt' writing manifest file 'protobuf.egg-info/SOURCES.txt' running build_ext Traceback (most recent call last): File ./setup.py, line 131, in module Protocol Buffers are Google's data interchange format., File /usr/local/lib/python2.6/distutils/core.py, line 152, in setup dist.run_commands() File /usr/local/lib/python2.6/distutils/dist.py, line 975, in run_commands self.run_command(cmd) File /usr/local/lib/python2.6/distutils/dist.py, line 995, in run_command cmd_obj.run() File build/bdist.freebsd-7.0-RELEASE-i386/egg/setuptools/command/test.py, line 121, in run File build/bdist.freebsd-7.0-RELEASE-i386/egg/setuptools/command/test.py, line 101, in with_project_on_sys_path File build/bdist.freebsd-7.0-RELEASE-i386/egg/setuptools/command/test.py, line 130, in run_tests File /usr/local/lib/python2.6/unittest.py, line 816, in __init__ self.parseArgs(argv) File /usr/local/lib/python2.6/unittest.py, line 843, in parseArgs self.createTests() File /usr/local/lib/python2.6/unittest.py, line 849, in createTests self.module) File /usr/local/lib/python2.6/unittest.py, line 613, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File /usr/local/lib/python2.6/unittest.py, line 598, in loadTestsFromName test = obj() File /usr/home/psha/protobuf/python/setup.py, line 62, in MakeTestSuite import google.protobuf.internal.generator_test as generator_test File /usr/home/psha/protobuf/python/google/protobuf/internal/generator_test.py, line 43, in module from google.protobuf import unittest_mset_pb2 File /usr/home/psha/protobuf/python/google/protobuf/unittest_mset_pb2.py, line 9, in module from google.protobuf import descriptor_pb2 File /usr/home/psha/protobuf/python/google/protobuf/descriptor_pb2.py, line 879, in module class FileDescriptorSet(message.Message): File /usr/home/psha/protobuf/python/google/protobuf/reflection.py, line 155, in __init__ superclass.__init__(cls, name, bases, dictionary) TypeError: Error when calling the metaclass bases type.__init__() takes 1 or 3 arguments --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---