From db39a81a30bac0cefdc6df952426a5dea269b2ca Mon Sep 17 00:00:00 2001 From: "Paul R. Tagliamonte" Date: Fri, 8 Mar 2013 20:21:32 -0500 Subject: [PATCH] fixing the thinger. --- hy/models/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hy/models/__init__.py b/hy/models/__init__.py index bf03b76..f10e883 100644 --- a/hy/models/__init__.py +++ b/hy/models/__init__.py @@ -28,9 +28,9 @@ class HyObject(object): def replace(self, other): if isinstance(other, HyObject): - self.start_line = other.start_line - self.end_line = other.end_line - self.start_column = other.start_column - self.end_column = other.end_column + for attr in ["start_line", "end_line", + "start_column", "end_column"]: + if not hasattr(self, attr): + setattr(self, attr, getattr(other, attr)) else: raise TypeError("Can't replace a non Hy object with a Hy object")