Mercurial > hgrepos > Python2 > PyMuPDF
comparison src/__init__.py @ 22:d77477b4e151
Let _int_rc() also handle (i.e. ignore) a local version suffix
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 19 Sep 2025 12:05:57 +0200 |
| parents | 1d09e1dec1d9 |
| children | 3b13504f9d89 |
comparison
equal
deleted
inserted
replaced
| 21:2f43e400f144 | 22:d77477b4e151 |
|---|---|
| 364 mupdf.internal_check_ndebug() | 364 mupdf.internal_check_ndebug() |
| 365 mupdf.reinit_singlethreaded() | 365 mupdf.reinit_singlethreaded() |
| 366 | 366 |
| 367 def _int_rc(text): | 367 def _int_rc(text): |
| 368 ''' | 368 ''' |
| 369 Converts string to int, ignoring trailing 'rc...'. | 369 Converts string to int, ignoring trailing 'rc...' and a trailing |
| 370 ''' | 370 local version. |
| 371 ''' | |
| 372 rc = text.find('+') | |
| 373 if rc >= 0: | |
| 374 text = text[:rc] | |
| 371 rc = text.find('rc') | 375 rc = text.find('rc') |
| 372 if rc >= 0: | 376 if rc >= 0: |
| 373 text = text[:rc] | 377 text = text[:rc] |
| 374 return int(text) | 378 return int(text) |
| 375 | 379 |
