#!/usr/bin/python3.4
# -*-coding:Utf-8 -*
import os

def saveSettings(s):
	global scriptSettings
	setFile = open(os.getcwd()+'/settings','w')
	setFile.write(s.toXmlStr(True))
	setFile.close()

def saveQueue(q):
	global renderQueue
	queueFile = open(os.getcwd()+'/queue','w')
	queueFile.write(q.toXmlStr(True))
	queueFile.close()

@@ -95,17 +95,12 @@
 gs%0A%09
-setFile =
+with
  ope
@@ -129,17 +129,30 @@
 gs','w')
-%0A
+ as setFile:%0A%09
 %09setFile
@@ -179,25 +179,8 @@
 ue))
-%0A%09setFile.close()
 %0A%0Ade
@@ -220,19 +220,12 @@
 ue%0A%09
-queueFile =
+with
  ope
@@ -251,17 +251,32 @@
 ue','w')
-%0A
+ as queueFile:%0A%09
 %09queueFi
@@ -306,23 +306,5 @@
 e))%0A
-%09queueFile.close()
 %0A

modify file openning method (use 'with open(…)as file:' syntax)