Fix stupid mishap
diff --git a/Lib/fontTools/misc/xmlWriter.py b/Lib/fontTools/misc/xmlWriter.py
index 6862e91..b3ce7f2 100644
--- a/Lib/fontTools/misc/xmlWriter.py
+++ b/Lib/fontTools/misc/xmlWriter.py
@@ -15,9 +15,9 @@
 		if not hasattr(fileOrPath, "write"):
 			try:
 				# Python3 has encoding support.
-				self.file = open(fileOrPath, "w")
-			except TypeError:
 				self.file = open(fileOrPath, "w", encoding="utf-8")
+			except TypeError:
+				self.file = open(fileOrPath, "w")
 		else:
 			# assume writable file object
 			self.file = fileOrPath