* Matt Kraai <kr...@ftbfs.org>, 2010-07-03, 11:38:
I backported pytrainer 1.7.2-1 to lenny and tried to run it on a
mipsel machine, but it failed to run with the following error:

Unsupported sys.platform: linux2-mipsel.

The attached patch fixed this problem.

pytrainer won't run also on kfreebsd-* and hurd-*, both with and without Matt's patch. Please consider applying my (untested, sorry) patch instead.

--
Jakub Wilk
--- pytrainer-1.7.2.orig/pytrainer/lib/system.py
+++ pytrainer-1.7.2/pytrainer/lib/system.py
@@ -37,12 +37,12 @@
 		self._setGpxDir()
 
 	def _setHome(self):
-		if sys.platform == "linux2":
+		if os.name == 'posix':
 			variable = 'HOME'
-		elif sys.platform == "win32":
+		elif os.name == 'nt':
 			variable = 'USERPROFILE'
 		else:
-			print "Unsupported sys.platform: %s." % sys.platform
+			print "Unsupported os.name: %s." % os.name
 			sys.exit(1)
 		self.home = os.environ[variable]
     
@@ -65,12 +65,12 @@
 					os.remove(os.path.join(self.tmpdir, name))
    
 	def _setConfFiles(self):
-		if sys.platform == "win32":
+		if os.name == 'nt':
 			self.confdir = self.home+"/pytrainer"
-		elif sys.platform == "linux2":
+		elif os.name == 'posix':
 			self.confdir = self.home+"/.pytrainer"
 		else:
-			print "Unsupported sys.platform: %s." % sys.platform
+			print "Unsupported os.name: %s." % os.name
 			sys.exit(1)
 		self.conffile = self.confdir+"/conf.xml"
 		if not os.path.isdir(self.confdir):

Attachment: signature.asc
Description: Digital signature

Reply via email to