Skip to content

Commit

Permalink
Triage 5
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion committed Jul 27, 2024
1 parent 79b594a commit eb7296e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 31 deletions.
58 changes: 29 additions & 29 deletions .github/workflows/pr-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions pynetdicom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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
Expand Down

0 comments on commit eb7296e

Please sign in to comment.