From eb7296e3894d836ee699c566d8c0331e25a276a5 Mon Sep 17 00:00:00 2001 From: scaramallion Date: Sat, 27 Jul 2024 12:29:16 +1000 Subject: [PATCH] Triage 5 --- .github/workflows/pr-pytest.yml | 58 ++++++++++++++++----------------- pynetdicom/utils.py | 6 ++-- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/.github/workflows/pr-pytest.yml b/.github/workflows/pr-pytest.yml index 8a1e11098..68e110535 100644 --- a/.github/workflows/pr-pytest.yml +++ b/.github/workflows/pr-pytest.yml @@ -6,35 +6,35 @@ on: jobs: - conda: - # Test conda build with latest Python version - runs-on: ubuntu-latest - timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - python-version: ['3.10'] - - steps: - - uses: actions/checkout@v4 - - name: Setup conda - uses: s-weigand/setup-conda@v1 - with: - update-conda: true - python-version: ${{ matrix.python-version }} - conda-channels: anaconda, conda-forge - - name: Install dependencies - run: | - conda install pytest - conda install -c conda-forge pydicom - - name: Get OpenSSL version - run: | - python -c "import ssl; print('OpenSSL:', ssl.OPENSSL_VERSION_INFO)" - - name: Test with pytest - env: - PYTHON_VERSION: ${{ matrix.python-version }} - run: | - pytest -x --ignore=pynetdicom/apps + # conda: + # # Test conda build with latest Python version + # runs-on: ubuntu-latest + # timeout-minutes: 30 + # strategy: + # fail-fast: false + # matrix: + # python-version: ['3.10'] + # + # steps: + # - uses: actions/checkout@v4 + # - name: Setup conda + # uses: s-weigand/setup-conda@v1 + # with: + # update-conda: true + # python-version: ${{ matrix.python-version }} + # conda-channels: anaconda, conda-forge + # - name: Install dependencies + # run: | + # conda install pytest + # conda install -c conda-forge pydicom + # - name: Get OpenSSL version + # run: | + # python -c "import ssl; print('OpenSSL:', ssl.OPENSSL_VERSION_INFO)" + # - name: Test with pytest + # env: + # PYTHON_VERSION: ${{ matrix.python-version }} + # run: | + # pytest -x --ignore=pynetdicom/apps windows: runs-on: windows-latest diff --git a/pynetdicom/utils.py b/pynetdicom/utils.py index 112d051ca..ea3e38a6f 100644 --- a/pynetdicom/utils.py +++ b/pynetdicom/utils.py @@ -304,6 +304,8 @@ def set_timer_resolution(resolution: Optional[float]) -> Iterator[None]: resolution = max(int(resolution * 10000), minimum.value) resolution = min(resolution, maximum.value) + original = current.value + # Set the timer resolution dll.NtSetTimerResolution(resolution, 1, ctypes.byref(current)) @@ -315,12 +317,12 @@ def set_timer_resolution(resolution: Optional[float]) -> Iterator[None]: yield None # Reset the timer resolution - dll.NtSetTimerResolution(current.value, 1, ctypes.byref(current)) + dll.NtSetTimerResolution(original, 1, ctypes.byref(current)) dll.NtQueryTimerResolution( ctypes.byref(maximum), ctypes.byref(minimum), ctypes.byref(now) ) - print("After", minimum.value, maximum.value, now.value) + print("After", minimum.value, maximum.value, now.value, original) else: yield None