mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-21 21:50:54 +07:00
Previously, it used an odd convention with lowercased names of test data files (with nothing separating individual words), which made adding new tests quite tedious. Also, I removed the test data "exit.py" as it wasn't used by any test. GitOrigin-RevId: 92b1963c67ed01977f5b7ad020984056c9fe045d
13 lines
316 B
Python
13 lines
316 B
Python
import sys
|
|
|
|
try:
|
|
f = open('myfile.txt')
|
|
s = f.readline()
|
|
i = int(s.strip())
|
|
except IOError as (errno, strerror):
|
|
print "I/O error({0}): {1}".format(errno, strerror)
|
|
except ValueError:
|
|
print "Could not convert data to an integer."
|
|
except:
|
|
print "Unexpected error:", sys.exc_info()[0]
|
|
raise |