Skip to content

Py32 cleanup #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed

Py32 cleanup #44

wants to merge 5 commits into from

Conversation

rgommers
Copy link
Member

@rgommers rgommers commented Mar 1, 2011

Some cleaning of messages from the new and shiny Python 3.2.

There is one ResourceWarning left (see below), I can't see how to fix it.
test_mmap (test_io.TestSaveLoad) ... /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/lib/format.py:575: ResourceWarning: unclosed file <_io.BufferedReader name='/var/folders/Uu/UuXfo1NLFae4yyYpsCz-XE+++TI/-Tmp-/tmp37lh1w'>
mode=mode, offset=offset)

@charris
Copy link
Member

charris commented Mar 2, 2011

This looks good to me once the stdout bit in numpy/lib/tests/test_regression is removed.

@rgommers
Copy link
Member Author

rgommers commented Mar 2, 2011

I guess this is the reason:

In [11]: tmp = np.who({'foo' : np.array(1)})

Name            Shape            Bytes            Type
===========================================================

foo                              4                int32

Upper bound on total bytes  =       4

Keep it after all? It hasn't given any problems so far.

@charris
Copy link
Member

charris commented Mar 2, 2011

I think it should be modified to something like:

oldstdout = sys.stdout
try:
... 
except:
...
finally:
    sys.stdout = oldstdout

and perhaps a note added to explain. I'll do that and commit tomorrow if you don't.

I wonder how persistent changes to modules imported locally in functions are?

@rgommers
Copy link
Member Author

rgommers commented Mar 2, 2011

I'll try now. Should just be nested try-finally and try-except, otherwise it's not valid Python 2.4 code.

@rgommers
Copy link
Member Author

rgommers commented Mar 2, 2011

OK, commited. Thanks Charles.

mattip referenced this pull request in mattip/numpy Mar 20, 2019
BUG: Protect gamma generation from 0 input
fangerer pushed a commit to hpyproject/numpy-hpy that referenced this pull request Jul 7, 2022
Merge in ~STEPAN.SINDELAR_ORACLE.COM/numpy-hpy from tim/graalpython-run to labs-hpy-port

* commit 'cc28777a2d2416a0cffafe4ba203f1e04058b8be':
  remove legacy slots & make types non-legacy if NO_LEGACY is defined
  skip tp_weaklistoffset for graalpython
  remove leftover printf
  port tiny forgotten bit in initumath to hpy
  port remainder of set_typeinfo to hpy
  use convenience enum value for .legacy on dtype types
  fix premature close of h_PyGenericArrType_Type
luyahan pushed a commit to plctlab/numpy that referenced this pull request Apr 25, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants