Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
wjwwood committed Mar 30, 2016
1 parent 30e109c commit f161c04
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions rclpy/rclpy/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ class NotInitializedException(Exception):
"""Raised when the rclpy implementation is accessed before rclpy.init()."""

def __init__(self, *args):
Exception.__init__(self, "rclpy.init() has not been called", *args)
Exception.__init__(self, 'rclpy.init() has not been called', *args)


class ImplementationAlreadyImportedException(Exception):
"""Raised on select_rmw_implemenation() after import_rmw_implementation() has been called."""

def __init__(self, *args):
Exception.__init__(self, "rmw implementation already imported", *args)
Exception.__init__(self, 'rmw implementation already imported', *args)


class InvalidRCLPYImplementation(Exception):
"""Raised when an invalid RCLPYImplementation is requested."""

def __init__(self, *args):
Exception.__init__(self, "requested invalid rmw implementation", *args)
Exception.__init__(self, 'requested invalid rmw implementation', *args)
10 changes: 5 additions & 5 deletions rclpy/rclpy/impl/object_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __contains__(self, ob):
'iter', 'oct', 'hex'
]:
code_object = compile(
"def __{0}__(self): return {0}(self.__actual__)".format(name),
'def __{0}__(self): return {0}(self.__actual__)'.format(name),
__file__,
'exec',
ast.PyCF_ONLY_AST,
Expand All @@ -86,7 +86,7 @@ def __contains__(self, ob):

for name in ['cmp', 'coerce', 'divmod']:
code_object = compile(
"def __{0}__(self, ob): return {0}(self.__actual__, ob)".format(name),
'def __{0}__(self, ob): return {0}(self.__actual__, ob)'.format(name),
__file__,
'exec',
ast.PyCF_ONLY_AST,
Expand All @@ -98,7 +98,7 @@ def __contains__(self, ob):
('lt', '<'), ('gt', '>'), ('le', '<='), ('ge', '>='), ('eq', '=='), ('ne', '!=')
]:
code_object = compile(
"def __{0}__(self, ob): return self.__actual__ {1} ob".format(name, op),
'def __{0}__(self, ob): return self.__actual__ {1} ob'.format(name, op),
__file__,
'exec',
ast.PyCF_ONLY_AST,
Expand All @@ -108,7 +108,7 @@ def __contains__(self, ob):

for name, op in [('neg', '-'), ('pos', '+'), ('invert', '~')]:
code_object = compile(
"def __{0}__(self): return {1} self.__actual__".format(name, op),
'def __{0}__(self): return {1} self.__actual__'.format(name, op),
__file__,
'exec',
ast.PyCF_ONLY_AST,
Expand Down Expand Up @@ -159,7 +159,7 @@ def __rpow__(self, ob):
class ObjectProxy(AbstractProxy):
"""Proxy for an internally stored object."""

__slots__ = "__actual__"
__slots__ = '__actual__'

def __init__(self, subject):
self.__actual__ = subject
2 changes: 1 addition & 1 deletion rclpy/test/talker.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ def talker():
except KeyboardInterrupt:
print('talker stopped cleanly')
except BaseException:
print('exception in talker:')
print('exception in talker:', file=sys.stderr)
raise
5 changes: 3 additions & 2 deletions rclpy/test/test_select_rmw_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import ctypes
import multiprocessing
import os
import sys
import traceback

# TODO(wjwwood): remove this once we get all the identifiers consistent
Expand All @@ -28,7 +29,7 @@ def run_catch_report_raise(func, *args, **kwargs):
try:
return func(*args, **kwargs)
except:
print("exception in {0}():".format(func.__name__))
print('exception in {0}():'.format(func.__name__), file=sys.stderr)
traceback.print_exc()
raise

Expand Down Expand Up @@ -102,7 +103,7 @@ def func_select_rmw_implementation_by_environment(rmw_implementation):
# (probably use a separate ament index entry).
return ctypes.c_bool(True)
print("Failed to import rmw implementation '{0}', ignoring."
.format(rmw_implementation))
.format(rmw_implementation), file=sys.stderr)
raise

set_rmw = rclpy.get_implementation_identifier()
Expand Down

0 comments on commit f161c04

Please sign in to comment.