diff options
author | Leifur Halldor Asgeirsson <lasgeirsson@zerofail.com> | 2016-03-04 12:46:55 -0500 |
---|---|---|
committer | Leifur Halldor Asgeirsson <lasgeirsson@zerofail.com> | 2016-03-18 15:58:19 -0400 |
commit | 1abda1f02ba2412ae845f1427370c52cef821756 (patch) | |
tree | 34eaf15b1fbda1ad4fe941f31ab0f967d4e223db /src/python/grpcio/grpc/framework/foundation/future.py | |
parent | 4302be789d89703d48f033c44720f828765f1467 (diff) |
specify metaclasses in a py3-compatible way
Diffstat (limited to 'src/python/grpcio/grpc/framework/foundation/future.py')
-rw-r--r-- | src/python/grpcio/grpc/framework/foundation/future.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/python/grpcio/grpc/framework/foundation/future.py b/src/python/grpcio/grpc/framework/foundation/future.py index bfc16fc1ea..bb8ee3ad87 100644 --- a/src/python/grpcio/grpc/framework/foundation/future.py +++ b/src/python/grpcio/grpc/framework/foundation/future.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -49,6 +49,8 @@ built-in-but-only-in-3.3-and-later TimeoutError. import abc +import six + class TimeoutError(Exception): """Indicates that a particular call timed out.""" @@ -58,13 +60,12 @@ class CancelledError(Exception): """Indicates that the computation underlying a Future was cancelled.""" -class Future(object): +class Future(six.with_metaclass(abc.ABCMeta)): """A representation of a computation in another control flow. Computations represented by a Future may be yet to be begun, may be ongoing, or may have already completed. """ - __metaclass__ = abc.ABCMeta # NOTE(nathaniel): This isn't the return type that I would want to have if it # were up to me. Were this interface being written from scratch, the return |