changeset 91:c62c9bfd614a

Removed import_error It was buggy anyway.
author Oleg Oshmyan <chortos@inbox.lv>
date Mon, 28 Feb 2011 16:05:20 +0000
parents 1fb319ec33af
children 17041a71bc02
files config.py files.py problem.py testcases.py unix.py upreckon-vcs win32.py
diffstat 7 files changed, 17 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/config.py	Mon Feb 28 15:32:22 2011 +0000
+++ b/config.py	Mon Feb 28 16:05:20 2011 +0000
@@ -2,14 +2,9 @@
 
 from __future__ import division, with_statement
 
-try:
-	from compat import *
-	import files
-except ImportError:
-	import __main__
-	__main__.import_error(sys.exc_info()[1])
-else:
-	from __main__ import options
+from compat import *
+import files
+from __main__ import options
 
 if files.ZipArchive:
 	try:
--- a/files.py	Mon Feb 28 15:32:22 2011 +0000
+++ b/files.py	Mon Feb 28 16:05:20 2011 +0000
@@ -4,12 +4,7 @@
 
 from __future__ import division, with_statement
 
-try:
-	from compat import *
-except ImportError:
-	import __main__
-	__main__.import_error(sys.exc_info()[1])
-
+from compat import *
 import contextlib, os, shutil, sys
 
 # You don't need to know about anything else.
--- a/problem.py	Mon Feb 28 15:32:22 2011 +0000
+++ b/problem.py	Mon Feb 28 16:05:20 2011 +0000
@@ -2,14 +2,9 @@
 
 from __future__ import division, with_statement
 
-try:
-	from compat import *
-	import config, testcases
-except ImportError:
-	import __main__
-	__main__.import_error(sys.exc_info()[1])
-else:
-	from __main__ import options
+from compat import *
+import config, testcases
+from __main__ import options
 
 import os, re, sys
 
--- a/testcases.py	Mon Feb 28 15:32:22 2011 +0000
+++ b/testcases.py	Mon Feb 28 16:05:20 2011 +0000
@@ -4,14 +4,9 @@
 
 from __future__ import division, with_statement
 
-try:
-	from compat import *
-	import files, problem, config
-except ImportError:
-	import __main__
-	__main__.import_error(sys.exc_info()[1])
-else:
-	from __main__ import options
+from compat import *
+import files, problem, config
+from __main__ import options
 
 import glob, re, sys, tempfile, time
 from subprocess import Popen, PIPE, STDOUT
--- a/unix.py	Mon Feb 28 15:32:22 2011 +0000
+++ b/unix.py	Mon Feb 28 16:05:20 2011 +0000
@@ -1,14 +1,9 @@
 # Copyright (c) 2010-2011 Chortos-2 <chortos@inbox.lv>
 
 from __future__ import division, with_statement
-import sys
 
-try:
-	from compat import *
-	import testcases  # mutual import
-except ImportError:
-	import __main__
-	__main__.import_error(sys.exc_info()[1])
+from compat import *
+import testcases  # mutual import
 
 from subprocess import Popen
 import os, sys, time
--- a/upreckon-vcs	Mon Feb 28 15:32:22 2011 +0000
+++ b/upreckon-vcs	Mon Feb 28 16:05:20 2011 +0000
@@ -4,10 +4,6 @@
 from __future__ import division, with_statement
 import optparse, sys, compat
 
-def import_error(e):
-	say('Error: your installation of Upreckon is incomplete;', str(e).lower() + '.', file=sys.stderr)
-	sys.exit(3)
-
 from compat import *
 
 version = '2.00.0 ($$REV$$)'
@@ -65,10 +61,7 @@
 if options.legacy:
 	compat.pseudobuiltins += 'xrange',
 
-try:
-	import testcases
-except ImportError:
-	import_error(sys.exc_info()[1])
+import testcases
 
 try:
 	from testcases import pause
@@ -89,10 +82,7 @@
 		else:
 			sys.exit('Error: configuration variable pause is not defined and cannot be devised automatically.')
 
-	try:
-		from problem import *
-	except ImportError:
-		import_error(sys.exc_info()[1])
+	from problem import *
 
 	# Support single-problem configurations
 	if globalconf.problems is None:
--- a/win32.py	Mon Feb 28 15:32:22 2011 +0000
+++ b/win32.py	Mon Feb 28 16:05:20 2011 +0000
@@ -1,19 +1,15 @@
 # Copyright (c) 2010-2011 Chortos-2 <chortos@inbox.lv>
 
 from __future__ import division, with_statement
-import sys
 
-try:
-	from compat import *
-	import testcases  # mutual import
-except ImportError:
-	import __main__
-	__main__.import_error(sys.exc_info()[1])
+from compat import *
+import testcases  # mutual import
 
 from ctypes import *
 from ctypes.wintypes import *
 from msvcrt import getch as pause
 from subprocess import Popen
+import sys
 
 try:
 	from testcases import clock