diff --git a/examples/roman10.py b/examples/roman10.py index a6f23fb..506f8cd 100644 --- a/examples/roman10.py +++ b/examples/roman10.py @@ -28,10 +28,10 @@ from_roman_table = {} def to_roman(n): '''convert integer to Roman numeral''' - if not (0 < n < 5000): - raise OutOfRangeError('number out of range (must be 1..4999)') if int(n) != n: raise NotIntegerError('non-integers can not be converted') + if not (0 < n < 5000): + raise OutOfRangeError('number out of range (must be 1..4999)') return to_roman_table[n] def from_roman(s): diff --git a/examples/roman9.py b/examples/roman9.py index e97f75a..1c466e7 100644 --- a/examples/roman9.py +++ b/examples/roman9.py @@ -38,10 +38,10 @@ roman_numeral_pattern = re.compile(''' def to_roman(n): '''convert integer to Roman numeral''' - if not (0 < n < 5000): - raise OutOfRangeError('number out of range (must be 1..4999)') if not isinstance(n, int): raise NotIntegerError('non-integers can not be converted') + if not (0 < n < 5000): + raise OutOfRangeError('number out of range (must be 1..4999)') result = '' for numeral, integer in roman_numeral_map: diff --git a/refactoring.html b/refactoring.html index 5856381..f70ef39 100755 --- a/refactoring.html +++ b/refactoring.html @@ -240,10 +240,10 @@ FAILED (errors=3) def to_roman(n): '''convert integer to Roman numeral''' - if not (0 < n < 5000): - raise OutOfRangeError('number out of range (must be 1..4999)') if not isinstance(n, int): raise NotIntegerError('non-integers can not be converted') + if not (0 < n < 5000): + raise OutOfRangeError('number out of range (must be 1..4999)') result = '' for numeral, integer in roman_numeral_map: diff --git a/util/validate.py b/util/validate.py index 403c063..2458cbf 100644 --- a/util/validate.py +++ b/util/validate.py @@ -2,7 +2,7 @@ import sys try: import html5lib except ImportError: - sys.path.insert(0, '/Users/pilgrim/code/html5lib/python3/src/') + sys.path.insert(0, '/home/pilgrim/code/html5lib/python3/src/') import html5lib input_filename = sys.argv[1]