Commit Graph

9 Commits

Author SHA1 Message Date
Mario Fetka 4e0d448aef Python 3.12+/3.13 and portage 3.0.77 compatibility fixes
- Replace deprecated Thread.isAlive() with is_alive() (Python 3.12)
- Fix invalid escape sequences in regex strings (SyntaxWarning → SyntaxError)
- Replace removed unittest aliases: assertEquals→assertEqual,
  assertNotEquals→assertNotEqual, assert_→assertTrue,
  assertRaisesRegexp→assertRaisesRegex (Python 3.12)
- Replace portage's removed clear_caches() with flush_cache()
- Fix locks.py: reset TLS state on exception in _file_lock_create
  to prevent stale shared-lock state poisoning subsequent acquisitions
- Skip os.chown() when gid is None or caller lacks permission
- Fix FastRSS attribute ordering for consistent minidom re-parse behavior
- Update test expected XML to match Python 3.8+ minidom attribute order

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 10:53:13 +02:00
Fabio Erculiani 603c96fc05 [entropy.locks] add is_already_acquired()
This method returns whether the lock has been already acquired.
It is useful in cases where the reentrancy property is leveraged.
2013-12-26 22:52:13 +01:00
Fabio Erculiani 0df7092e05 [entropy.locks] drop "_lock", just "acquire" or "release", it's cleaner 2013-12-26 22:52:11 +01:00
Fabio Erculiani 1f2575204e [entropy.locks] make ResourceLock reentrant wrt to individual threads only 2013-12-26 22:52:11 +01:00
Fabio Erculiani 94ab49fd0b [tests] use const_mk{s,d}temp instead of tmpfile ones, default TMPDIR to /var/tmp 2013-12-09 14:36:34 +01:00
Fabio Erculiani 6a2d45df47 [entropy.locks] set recursed to False only when the reference counter is 0 2013-12-09 14:24:37 +01:00
Fabio Erculiani d080db0d3b [tests] locks: fix test class name 2013-12-09 14:21:05 +01:00
Fabio Erculiani bf3a8b79f9 [entropy.locks] use TLS for reentrancy safety checks, update tests 2013-12-09 14:19:21 +01:00
Fabio Erculiani ebf63e6060 [entropy.locks] fix shared/exclusive locking mix due to reentrancy, add tests 2013-12-08 16:15:39 +01:00