+
+
+def _make_replication_server(url):
+ """ Returns a ReplicationServer in form of a context manager.
+
+ Creates a light wrapper around older versions of pyosmium that did
+ not support the context manager interface.
+ """
+ if hasattr(ReplicationServer, '__enter__'):
+ return ReplicationServer(url)
+
+ @contextmanager
+ def get_cm():
+ yield ReplicationServer(url)
+
+ return get_cm()