~pythonregexp2.7/python/issue2636-09-01+10

« back to all changes in this revision

Viewing changes to Demo/classes/bitvec.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-22 21:39:45 UTC
  • mfrom: (39055.1.33 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080922213945-23717m5eiqpamcyn
Merged in changes from the Single-Loop Engine branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
import sys; rprt = sys.stderr.write #for debugging
8
8
 
9
 
error = 'bitvec.error'
 
9
class error(Exception):
 
10
    pass
10
11
 
11
12
 
12
13
def _check_value(value):
20
21
    mant, l = math.frexp(float(param))
21
22
    bitmask = 1L << l
22
23
    if bitmask <= param:
23
 
        raise 'FATAL', '(param, l) = %r' % ((param, l),)
 
24
        raise RuntimeError('(param, l) = %r' % ((param, l),))
24
25
    while l:
25
26
        bitmask = bitmask >> 1
26
27
        if param & bitmask: