added filter warnings for older versions of python (<3.7)#11396
Conversation
| """ | ||
| warnings.filterwarnings("default", category=DeprecationWarning, module=self.user_ns.get("__name__")) | ||
| #warnings.filterwarnings("default", category=DeprecationWarning, module=self.user_ns.get("__name__")) | ||
| if sys.version_info < 3.7: |
There was a problem hiding this comment.
Change to:
if sys.version_info < (3, 7)
This is becasuse sys.version_info on py3 does not support the < operator (or that is my conclussion)
There was a problem hiding this comment.
Ok! Doing it right now.
My biggest concern actually was if it resolved what the issue implied. How can I test my code?
|
Thanks ! You did commit all your Then we can walk through how to squash your history for those files to not be added to repo. If you code work on Python 3.7 at the REPL you should see the following: |
| """ | ||
| warnings.filterwarnings("default", category=DeprecationWarning, module=self.user_ns.get("__name__")) | ||
| if sys.version_info < (3,7): | ||
| warnings.filterwarnings("default", category=DeprecationWarning, module=self.user_ns.get("__name__")) |
|
Good job, and thanks @eamanu for the review ! |
|
Thank you @Carreau ! I'm new to pull requests, so thank you for sending me this tutorial. I'll come back with changes in a bit. |
|
Feel free to ask if you want more guidance. I'll stay short on purpose – to gitve you the opportunity to figure it out by yourself – but I can give you detailed instructions if needed. |
|
Thank you @Carreau !
It wasn't working properly, though, because I had to remove the files from git's tracking. I removed them with git rm -rf .idea and it said that the files inside the folder were succesfully removed. But whenever I tried to commit and push, the repository was already up-to-date.
and it worked. Does this sound right? Is there a better way to do it? Thanks |
|
It's good, let me show you how to rewrite the history to have only one clean commit and not have the intermediate .idea files in history. We'll rebase interactive ( Now you can force push. Here is it as a gif. If it's too complicated I can do that for you. |
|
Great! |
This is a "squash" of three commits into one. This means that the intermediate history has been rewritten.
9b63fb5 to
8c11a03
Compare
|
Hi there @Carreau ! Thank you for the help, I believe I did successfully what you asked for. This GIF is great! What are the next steps now? should we do some more testing? |
Than you @eamanu ! |
No more step for this issue that you. For this specific issue I don't think more testing is necessary I'll just update 11333 so that once we drop 3.6 the code can actually be removed.... but that will take a couple of years. Good job! |
@Carreau thank you! Now I'm looking for more issues to work on, do you have any suggestions? |
Not particularly, I'll have to go through and figure out if issues are easy or hard. You can try to go through the list of what is needed for You should be able to also apply a subset of labels to issues by gently asking our bot like so: @meeseeksdev tag hacktoberfest I'll try to mark a few issue as "good first issue" and/or "help wanted" |

I simply added the
if sys.info_version < (3,7):
...code
mentioned in this issue on the init_deprecation_warnings() functions in the main IPython class. What i understood is that this issue is fixed for python 3.7 but not for older versions, so I guessed this should suffice.
I wanted opinions from more experienced developers in this project to help to check it and to test it.